Androbin Androbin - 3 months ago 31
Android Question

"Could not find class '...UserManager', referenced from method ...GooglePlayServicesUtil.zzah","... '...AppOpsManager', ...GooglePlayServicesUtil.zzb"

I've added Google Analytics to my Android Project and therefore followed all the instructions carefully, but anyway I'm getting this 2 error messages in the LogCat:

E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzah
W/dalvikvm: VFY: unable to resolve check-cast 276 (Landroid/os/UserManager;) in Lcom/google/android/gms/common/GooglePlayServicesUtil;

E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzb
W/dalvikvm: VFY: unable to resolve check-cast 25 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/GooglePlayServicesUtil;


This doesn't actually crash the application, but it would be great anyway, to know why I'm receiving this.

My Android Manifest: (without personal information)

<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.example.android"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application
android:allowBackup="true"
android:allowClearUserData="true"
android:allowTaskReparenting="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:restoreAnyVersion="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>

<receiver
android:name="com.google.android.gms.analytics.AnalyticsReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH"/>
</intent-filter>
</receiver>

<receiver
android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.analytics.AnalyticsService"
android:enabled="true"
android:exported="false"/>

<service android:name="com.google.android.gms.analytics.CampaignTrackingService"/>

</application>

</manifest>


Does anyone of you know about this errors?

Gradle:

...
classpath 'com.android.tools.build:gradle:1.4.0-beta3'
classpath 'com.google.gms:google-services:1.4.0-beta3'
...
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
...
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
...

Answer

Refering to Koh

"UserManager requires API level 17 while AppOpsManager requires API level 19. [...] Otherwise, this could be a multidex issue such as here."