Getting error: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza

前端 未结 2 1852
日久生厌
日久生厌 2020-11-27 07:59

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 b

2条回答
  •  一整个雨季
    2020-11-27 08:08

    I followed the 2nd approach mentioned by jackaal. I had included the whole play services in my gradle. After removing this and selecting only the required play services apis fixed my problem.

    Since the play services has a lot of apis, the total method count is beyond 65k by itself. So this causes error in mobiles with api level 21 and below.

    Before gradle:-

    compile 'com.google.android.gms:play-services:8.4.0'
    

    After gradle:-

    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.google.android.gms:play-services-plus:8.4.0'
    

提交回复
热议问题