我在安静的时候遇到这个问题,我也检查了其他解决方案,但他们不适合我。
我使用的是firebase
版本11.0.2,google play services
版本42,Android sdk
工具版本26.0.2,Android sdk platform tools
版本26.0.0和emulator
版本26.1.2。
build.gradle
文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig
{
applicationId "com.mobility.mobilityindia"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.google.firebase:firebase-core:11.0.2"
compile "com.google.firebase:firebase-auth:11.0.2"
compile "com.google.firebase:firebase-database:11.0.2"
compile "com.android.support:appcompat-v7:26.+"
compile "com.google.android.gms:play-services-auth:11.0.2"
compile "com.android.support:support-v4:26.+"
compile "com.google.android.gms:play-services:11.0.2"
compile "com.android.support:design:26.+"
compile "com.android.support.test.espresso:espresso-core:2.2.2"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
Logcat
07-12 14:39:29.816 2372-2372/? I/art: Not late-enabling -Xcheck:jni (already on)
07-12 14:39:29.820 2372-2372/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-12 14:39:30.391 2372-2372/com.mobility.mobilityindia W/System: ClassLoader referenced unknown path: /data/app/com.mobility.mobilityindia-1/lib/x86
07-12 14:39:30.949 2372-2372/com.mobility.mobilityindia I/FA: App measurement is starting up, version: 11020
07-12 14:39:30.950 2372-2372/com.mobility.mobilityindia I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-12 14:39:31.047 2372-2372/com.mobility.mobilityindia V/FA: Collection enabled
07-12 14:39:31.047 2372-2372/com.mobility.mobilityindia V/FA: App package, google app id: com.mobility.mobilityindia, 1:308094300316:android:8bb92942b462bf39
07-12 14:39:31.048 2372-2372/com.mobility.mobilityindia I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.mobility.mobilityindia
07-12 14:39:31.048 2372-2372/com.mobility.mobilityindia D/FA: Debug-level message logging enabled
07-12 14:39:31.097 2372-2393/com.mobility.mobilityindia W/art: Verification of com.google.android.gms.common.internal.zzf com.google.android.gms.common.internal.zzd.zze(com.google.android.gms.common.internal.zzd) took 122.191ms
07-12 14:39:31.153 2372-2393/com.mobility.mobilityindia W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
07-12 14:39:31.192 2372-2393/com.mobility.mobilityindia W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298470
07-12 14:39:31.197 2372-2372/com.mobility.mobilityindia V/FA: Cancelling job. JobID: -631849166
07-12 14:39:31.246 2372-2372/com.mobility.mobilityindia V/FA: Registered activity lifecycle callback
07-12 14:39:31.251 2372-2372/com.mobility.mobilityindia I/FirebaseInitProvider: FirebaseApp initialization successful
07-12 14:39:31.253 2372-2372/com.mobility.mobilityindia I/InstantRun: starting instant run server: is main process
07-12 14:39:31.290 2372-2415/com.mobility.mobilityindia V/FA: Using measurement service
07-12 14:39:31.291 2372-2415/com.mobility.mobilityindia V/FA: Connecting to remote service
07-12 14:39:31.295 2372-2415/com.mobility.mobilityindia W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298470
07-12 14:39:31.300 2372-2415/com.mobility.mobilityindia V/FA: Using measurement service
07-12 14:39:31.300 2372-2415/com.mobility.mobilityindia V/FA: Connection attempt already in progress
07-12 14:39:31.486 2372-2372/com.mobility.mobilityindia W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-12 14:39:31.521 2372-2372/com.mobility.mobilityindia V/FA: onActivityCreated
07-12 14:39:31.942 2372-2383/com.mobility.mobilityindia I/art: Background sticky concurrent mark sweep GC freed 5869(912KB) AllocSpace objects, 5(100KB) LOS objects, 0% free, 45MB/45MB, paused 7.350ms total 78.784ms
07-12 14:39:31.986 2372-2383/com.mobility.mobilityindia I/art: Background partial concurrent mark sweep GC freed 195(14KB) AllocSpace objects, 0(0B) LOS objects, 8% free, 45MB/49MB, paused 7.751ms total 39.084ms
07-12 14:39:32.943 2372-2383/com.mobility.mobilityindia I/art: Background sticky concurrent mark sweep GC freed 12(16KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 53MB/53MB, paused 7.772ms total 45.250ms
07-12 14:39:33.041 2372-2383/com.mobility.mobilityindia I/art: Background partial concurrent mark sweep GC freed 78(30KB) AllocSpace objects, 0(0B) LOS objects, 7% free, 53MB/57MB, paused 6.114ms total 95.568ms
07-12 14:39:33.068 2372-2372/com.mobility.mobilityindia I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
07-12 14:39:33.071 2372-2372/com.mobility.mobilityindia I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
07-12 14:39:33.101 2372-2415/com.mobility.mobilityindia V/FA: Using measurement service
07-12 14:39:33.101 2372-2415/com.mobility.mobilityindia V/FA: Connection attempt already in progress
07-12 14:39:33.202 2372-2372/com.mobility.mobilityindia W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
07-12 14:39:34.023 2372-2372/com.mobility.mobilityindia W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
07-12 14:39:34.028 2372-2420/com.mobility.mobilityindia I/OpenGLRenderer: Initialized EGL, version 1.4
07-12 14:39:34.028 2372-2420/com.mobility.mobilityindia D/OpenGLRenderer: Swap behavior 1
07-12 14:39:34.029 2372-2420/com.mobility.mobilityindia W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
07-12 14:39:34.029 2372-2420/com.mobility.mobilityindia D/OpenGLRenderer: Swap behavior 0
07-12 14:39:34.049 2372-2372/com.mobility.mobilityindia I/Choreographer: Skipped 49 frames! The application may be doing too much work on its main thread.
07-12 14:39:34.738 2372-2372/com.mobility.mobilityindia I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
07-12 14:39:35.049 2372-2396/com.mobility.mobilityindia I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
07-12 14:39:35.050 2372-2396/com.mobility.mobilityindia I/DynamiteModule: Selected local version of com.google.android.gms.flags
07-12 14:39:35.059 2372-2415/com.mobility.mobilityindia W/art: Long monitor contention with owner pool-2-thread-1 (2396) at boolean android.os.BinderProxy.transactNative(int, android.os.Parcel, android.os.Parcel, int)(Binder.java:-2) waiters=0 in int com.google.android.gms.dynamite.DynamiteModule.zzb(android.content.Context, java.lang.String, boolean) for 1.936s
07-12 14:39:35.080 2372-2396/com.mobility.mobilityindia W/System: ClassLoader referenced unknown path:
07-12 14:39:35.080 2372-2396/com.mobility.mobilityindia W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
07-12 14:39:35.081 2372-2396/com.mobility.mobilityindia D/ApplicationLoaders: ignored Vulkan layer search path /system/priv-app/PrebuiltGmsCore/lib/x86:/system/fake-libs:/system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86:/system/lib:/vendor/lib for namespace 0xabf7b090
07-12 14:39:35.207 2372-2396/com.mobility.mobilityindia W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
07-12 14:39:35.468 2372-2415/com.mobility.mobilityindia W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298470
07-12 14:39:35.469 2372-2415/com.mobility.mobilityindia I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:11 and remote module com.google.android.gms.tagmanager:0
07-12 14:39:35.469 2372-2415/com.mobility.mobilityindia I/DynamiteModule: Selected local version of com.google.android.gms.tagmanager
07-12 14:39:35.513 2372-2396/com.mobility.mobilityindia W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298470
07-12 14:39:35.513 2372-2396/com.mobility.mobilityindia I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:0
07-12 14:39:35.538 2372-2396/com.mobility.mobilityindia E/FirebaseCrash: Failed to load crash reporting
com.google.android.gms.internal.mn: com.google.android.gms.dynamite.DynamiteModule$zzc: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.internal.ml.zzFk(Unknown Source)
at com.google.firebase.crash.zzc.zzFi(Unknown Source)
at com.google.firebase.crash.zzd.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: com.google.android.gms.dynamite.DynamiteModule$zzc: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.dynamite.DynamiteModule.zza(Unknown Source)
at com.google.android.gms.internal.ml.zzFk(Unknown Source)
at com.google.firebase.crash.zzc.zzFi(Unknown Source)
at com.google.firebase.crash.zzd.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
07-12 14:39:35.539 2372-2398/com.mobility.mobilityindia E/FirebaseCrash: Failed waiting for crash api to load.
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1036)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1327)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:249)
at com.google.firebase.crash.FirebaseCrash.zzFc(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.zza(Unknown Source)
at com.google.firebase.crash.zza.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
07-12 14:39:35.591 2372-2415/com.mobility.mobilityindia W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
07-12 14:39:36.868 2372-2415/com.mobility.mobilityindia W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
07-12 14:39:36.868 2372-2415/com.mobility.mobilityindia I/GoogleTagManager: Tag Manager initilization took 1279ms
07-12 14:39:36.869 2372-2415/com.mobility.mobilityindia D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=8694756223472310512}]
07-12 14:39:36.973 2372-2415/com.mobility.mobilityindia V/FA: Using measurement service
07-12 14:39:36.973 2372-2415/com.mobility.mobilityindia V/FA: Connecting to remote service
07-12 14:39:36.977 2372-2415/com.mobility.mobilityindia W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298470
07-12 14:39:36.982 2372-2415/com.mobility.mobilityindia V/FA: Activity resumed, time: 75134
07-12 14:39:36.983 2372-2415/com.mobility.mobilityindia V/FA: Processing queued up service tasks: 4
07-12 14:39:36.983 2372-2415/com.mobility.mobilityindia E/FA: Discarding data. Failed to send app launch
07-12 14:39:36.983 2372-2372/com.mobility.mobilityindia W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
07-12 14:39:36.983 2372-2415/com.mobility.mobilityindia E/FA: Failed to get app instance id
07-12 14:39:36.984 2372-2415/com.mobility.mobilityindia E/FA: Failed to send current screen to service
07-12 14:39:36.984 2372-2415/com.mobility.mobilityindia E/FA: Discarding data. Failed to send event to service
07-12 14:39:36.984 2372-2415/com.mobility.mobilityindia V/FA: Processing queued up service tasks: 0
07-12 14:39:37.636 2372-2379/com.mobility.mobilityindia W/art: Suspending all threads took: 20.119ms
07-12 14:39:57.704 2372-2379/com.mobility.mobilityindia W/art: Suspending all threads took: 22.922ms
答案 0 :(得分:1)
此处的问题是firebase(11.0.2)
和google play services
不兼容,因为google play services
未更新。即使我去了Settings
- > {{1 }} - > SDK Manager
并更新SDK Tools
,最新版本为google play Services
,但仍然不兼容。
所以我在自己的智能手机上运行应用程序,它对我有用,因为google play services(10.9.3)
已经在我的手机上了。
答案 1 :(得分:0)
GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298470
这似乎是关键错误。当模拟器上的Google Play服务版本与应用程序build.gradle
中的版本不同时,就会发生这种情况。从错误中可以看出,模拟器运行的是版本10.2.9,而您已经在gradle中列出了版本11.0.2。
要解决此问题,请尝试将以下版本更改为10.2.9: -
compile "com.google.android.gms:play-services-auth:11.0.2"
compile "com.google.android.gms:play-services:11.0.2"
或者,如果可能,请更新为使用所需版本的Google Play服务的模拟器。