Mik*_*666 9 crash android google-play-services
我在Android 4.0.4上android.app.ActivityManager.getMyMemoryState缺少了很多方法。
完整的堆栈跟踪为:
Fatal Exception: java.lang.NoSuchMethodError: android.app.ActivityManager.getMyMemoryState
at com.google.android.gms.common.api.internal.BackgroundDetector.readCurrentStateIfPossible(Unknown Source:17)
at com.google.android.gms.common.api.internal.GoogleApiManager.handleMessage(Unknown Source:169)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.google.android.gms.internal.base.zap.dispatchMessage(Unknown Source:8)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:65
Run Code Online (Sandbox Code Playgroud)
我与gms相关的依存关系是:
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-games:16.0.0'
Run Code Online (Sandbox Code Playgroud)
+火力基地:
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-perf:16.2.3'
implementation 'com.google.firebase:firebase-ads:17.1.3'
Run Code Online (Sandbox Code Playgroud)
似乎是最新的(在撰写本文时)
我有什么办法可以防止这些崩溃?
我找到了此问题的来源:
play-services-base:16.1.0假设它至少在JellyBean(API级别16)操作系统上运行(我在Android Studio java反编译器的帮助下发现了这一点(PlatformVersion.isAtLeastJellyBean只是无条件地返回true。)),在我看来,这不是真的。
所以我降级play-services-base:16.1.0到play-services-base:16.0.1和崩溃停止。
| 归档时间: |
|
| 查看次数: |
826 次 |
| 最近记录: |