得到错误:找不到类的android.app.AppOpsManager“,从法com.google.android.gms.common.GooglePlayServicesUtil.zza引用找不到

2023-09-12 10:34:42 作者:完戏

我收到此错误和程序崩溃,当我尝试用超过API级别运行于手机应用程序22.然而,应用程序工作正常手机API级别22可能是什么的原因。

I receive this error and program crashes when I try to run the app on phone with older than API level 22. However the app works fine on phone with API level 22. What could be the reason for that.

这是我的依赖关系:

dependencies 
{
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.facebook.android:facebook-android-sdk:4.3.0'
    compile 'com.google.android.gms:play-services-analytics:7.5.0'

    compile project(':volley')
    compile project(':adjust_SDK')
    compile project(':euromessageLib')
    compile project(':com_viewpagerindicator')

    compile files('libs/adxtag3.2.6.jar')
    compile files('libs/jsoup-1.7.3.jar')
    compile files('libs/CWAC-Adapter.jar')
    compile files('libs/newrelic.android.jar')
    compile files('libs/android-query-full.0.26.8.jar')
    compile files('libs/khandroid-httpclient-4.2.3.jar')
    compile files('libs/GoogleConversionTrackingSdk-2.2.1.jar')

    compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') {
        transitive = true;
    }
}

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
    defaultConfig {
        applicationId "com.deneme"
        minSdkVersion 14
        targetSdkVersion 22
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles 'proguard.cfg'
        }
    }
    productFlavors {
    }
}

感谢帮助

推荐答案

花费几天时间来解决这个奇怪的问题后,终于找到了坠毁的原因。虽然仍有错误,程序没有任何问题,现在运行。

After spending couple of days to solve this strange problem, Finally found the cause of the crash. Although the error persists, program runs without any problem now.

为什么程序运行罚款与API级别22,而不是不低于21的原因是该方法的限制的机器人是65K。以上21原生支持的应用程序APK文件加载多个DEX文件,其中低于21则没有。文件指出这这里

The reason why the program runs fine with API level 22 and not not with below 21 is the method limit in android which is 65K. Above 21 natively supports loading multiple dex files from application APK files where below 21 does not. Documents states it here

针对此问题的解决方案,解决了在这个计算器帖子

The solution for this problem is solved at this stackoverflow post

如果你使用谷歌玩的,而不是编译整个API的服务,选择编译可能会有帮助。你可以找到更多的细节这里。

if you use google play services, instead of compiling the whole APIs, selectively compile may help. You can find more details here.