Robin Richtsfeld
Robin Richtsfeld

Reputation: 1036

Could not find class referenced from Google Play Services Util

I've added Google Analytics to my Android Project and followed all of the instructions, but still I'm getting this 2 error messages inside 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 to know why this is happening.

Android Manifest (obfuscated):

<?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 (shortened):

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'

Upvotes: 2

Views: 8555

Answers (1)

Robin Richtsfeld
Robin Richtsfeld

Reputation: 1036

Refering to Koh

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

Upvotes: 1

Related Questions