java - Firebase 应用程序可以在模拟器上运行,但不能在真实的 Android 设备上运行?

标签 java android xml

我正在为我的 Android 应用使用 Firebase 身份验证和数据库。一切都可以在模拟器上运行(Nexus 5X API 26、Nexus 6 API 26、Galaxy Nexus API 24)。当我在个人 Galaxy S6 Edge API 24 上启动该应用时,我的 Firebase 相关项目均不起作用。

这是从真正的 android 启动时的 Logcat:

    09-17 18:22:06.547 21928-21928/? E/Zygote: v2
09-17 18:22:06.547 21928-21928/? I/libpersona: KNOX_SDCARD checking this for 10081
09-17 18:22:06.547 21928-21928/? I/libpersona: KNOX_SDCARD not a persona
09-17 18:22:06.548 21928-21928/? E/Zygote: accessInfo : 0
09-17 18:22:06.548 21928-21928/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2],  Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0005, [-1 -1 -4 -1 0 1]
09-17 18:22:06.550 21928-21928/? I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=co.williamdev.cl 
09-17 18:22:06.553 21928-21928/? I/art: Late-enabling -Xcheck:jni
09-17 18:22:06.577 21928-21928/? D/TimaKeyStoreProvider: TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
09-17 18:22:06.614 21928-21928/co.williamdev.cl W/ActivityThread: Application co.williamdev.cl can be debugged on port 8100...
09-17 18:22:06.625 21928-21928/co.williamdev.cl W/System: ClassLoader referenced unknown path: /data/app/co.williamdev.cl-1/lib/arm64
09-17 18:22:06.688 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:22:06.692 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:22:06.728 21928-21928/co.williamdev.cl D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-17 18:22:06.735 21928-21928/co.williamdev.cl I/FA: App measurement is starting up, version: 10084
09-17 18:22:06.736 21928-21928/co.williamdev.cl I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-17 18:22:06.736 21928-21928/co.williamdev.cl D/FA: Debug-level message logging enabled
09-17 18:22:06.736 21928-21928/co.williamdev.cl D/FA: AppMeasurement singleton hash: 76751607
09-17 18:22:06.743 21928-21928/co.williamdev.cl V/FA: Collection enabled
09-17 18:22:06.743 21928-21928/co.williamdev.cl V/FA: App package, google app id: co.williamdev.cl, 1:414579005472:android:c605a1af30f21ce2
09-17 18:22:06.744 21928-21928/co.williamdev.cl I/FA: To enable faster debug mode event logging run:
                                                                adb shell setprop debug.firebase.analytics.app co.williamdev.cl
09-17 18:22:06.749 21928-21928/co.williamdev.cl V/FA: Registered activity lifecycle callback
09-17 18:22:06.750 21928-21928/co.williamdev.cl I/FirebaseInitProvider: FirebaseApp initialization successful
09-17 18:22:06.759 21928-21963/co.williamdev.cl V/FA: Using measurement service
09-17 18:22:06.760 21928-21963/co.williamdev.cl V/FA: Connecting to remote service
09-17 18:22:06.778 21928-21928/co.williamdev.cl 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
09-17 18:22:06.781 21928-21928/co.williamdev.cl V/FA: onActivityCreated
09-17 18:22:06.788 21928-21928/co.williamdev.cl W/DynamiteModule: Failed to load module via fast routecom.google.android.gms.dynamite.DynamiteModule$zza: V2 version check failed
09-17 18:22:06.791 21928-21928/co.williamdev.cl I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
09-17 18:22:06.791 21928-21928/co.williamdev.cl I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6
09-17 18:22:06.821 21928-21928/co.williamdev.cl W/System: ClassLoader referenced unknown path: 
09-17 18:22:06.840 21928-21928/co.williamdev.cl W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000002a/n/arm64-v8a
09-17 18:22:06.911 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.912 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.919 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.920 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.922 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.923 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.932 21928-21963/co.williamdev.cl V/FA: Using measurement service
09-17 18:22:06.932 21928-21963/co.williamdev.cl V/FA: Connection attempt already in progress
09-17 18:22:06.932 21928-21963/co.williamdev.cl V/FA: Activity resumed, time: 77667465
09-17 18:22:06.941 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: ThreadedRenderer.create() translucent=false
09-17 18:22:06.944 21928-21928/co.williamdev.cl D/InputTransport: Input channel constructed: fd=62
09-17 18:22:06.944 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: setView = DecorView@703995c[MainActivity] touchMode=true
09-17 18:22:06.947 21928-21928/co.williamdev.cl D/MainActivity: onAuthStateChanged:signed_in:a1uQCuf3RBT69ierqbhApFat3Ky2
09-17 18:22:06.960 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: dispatchAttachedToWindow
09-17 18:22:06.976 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.980 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.981 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.989 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:06.990 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:07.025 21928-21928/co.williamdev.cl D/AbsListView: Get MotionRecognitionManager
09-17 18:22:07.027 21928-21928/co.williamdev.cl D/MotionRecognitionManager: mSContextService = com.samsung.android.hardware.context.ISemContextService$Stub$Proxy@bb55fdb
09-17 18:22:07.031 21928-21928/co.williamdev.cl D/MotionRecognitionManager: motionService = com.samsung.android.gesture.IMotionRecognitionService$Stub$Proxy@dd0ba78
09-17 18:22:07.031 21928-21928/co.williamdev.cl D/MotionRecognitionManager: motionService = com.samsung.android.gesture.IMotionRecognitionService$Stub$Proxy@dd0ba78
09-17 18:22:07.068 21928-21928/co.williamdev.cl D/TextView: setTypeface with style : 0
09-17 18:22:07.069 21928-21928/co.williamdev.cl I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
09-17 18:22:07.101 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][1440,2560] result=0x7 surface={isValid=true 510201823232} surfaceGenerationChanged=true
09-17 18:22:07.101 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: mHardwareRenderer.initialize() mSurface={isValid=true 510201823232} hwInitialized=true
09-17 18:22:07.122 21928-21965/co.williamdev.cl D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
09-17 18:22:07.141 21928-21965/co.williamdev.cl I/OpenGLRenderer: Initialized EGL, version 1.4
09-17 18:22:07.141 21928-21965/co.williamdev.cl D/OpenGLRenderer: Swap behavior 1
09-17 18:22:07.146 21928-21965/co.williamdev.cl D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000,  [1440x2560]-format:1
09-17 18:22:07.188 21928-21928/co.williamdev.cl D/AbsListView:  onsize change 
09-17 18:22:07.278 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
09-17 18:22:07.278 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
09-17 18:22:07.278 21928-21928/co.williamdev.cl D/ViewRootImpl@a269bcf[MainActivity]: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true 510201823232}
09-17 18:22:07.299 21928-21928/co.williamdev.cl D/SEM_CLIP_SemClipboardManager: isCocktailBarDisplayed : false
09-17 18:22:07.299 21928-21928/co.williamdev.cl V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@a45ad61 nm : co.williamdev.cl ic=null
09-17 18:22:07.299 21928-21928/co.williamdev.cl I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
09-17 18:22:07.302 21928-21963/co.williamdev.cl D/FA: Connected to remote service
09-17 18:22:07.302 21928-21963/co.williamdev.cl V/FA: Processing queued up service tasks: 2
09-17 18:22:07.303 21928-21941/co.williamdev.cl D/InputTransport: Input channel constructed: fd=74
09-17 18:22:07.309 21928-21928/co.williamdev.cl V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@e092f12 nm : co.williamdev.cl ic=null
09-17 18:22:12.329 21928-21963/co.williamdev.cl V/FA: Inactivity, disconnecting from the service
09-17 18:22:45.273 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:22:49.077 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:22:49.079 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:22:59.163 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:23:05.775 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:23:05.777 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:23:24.611 21928-21953/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.

没有崩溃错误。

这是来自工作模拟器的 Logcat:

09-17 18:31:12.950 5373-5373/? I/zygote: Not late-enabling -Xcheck:jni (already on)
09-17 18:31:13.135 5373-5373/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
09-17 18:31:13.812 5373-5384/co.williamdev.cl I/zygote: Background concurrent copying GC freed 9975(2MB) AllocSpace objects, 0(0B) LOS objects, 79% free, 388KB/1924KB, paused 14.209ms total 332.236ms
09-17 18:31:13.893 5373-5394/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:31:14.028 5373-5373/co.williamdev.cl D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-17 18:31:14.066 5373-5373/co.williamdev.cl I/FA: App measurement is starting up, version: 10084
09-17 18:31:14.067 5373-5373/co.williamdev.cl I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-17 18:31:14.067 5373-5373/co.williamdev.cl D/FA: Debug-level message logging enabled
09-17 18:31:14.067 5373-5373/co.williamdev.cl D/FA: AppMeasurement singleton hash: 33108808
09-17 18:31:14.169 5373-5373/co.williamdev.cl V/FA: Collection enabled
09-17 18:31:14.169 5373-5373/co.williamdev.cl V/FA: App package, google app id: co.williamdev.cl, 1:414579005472:android:c605a1af30f21ce2
09-17 18:31:14.170 5373-5373/co.williamdev.cl I/FA: To enable faster debug mode event logging run:
                                                              adb shell setprop debug.firebase.analytics.app co.williamdev.cl
09-17 18:31:14.204 5373-5373/co.williamdev.cl V/FA: Registered activity lifecycle callback
09-17 18:31:14.211 5373-5373/co.williamdev.cl I/FirebaseInitProvider: FirebaseApp initialization successful
09-17 18:31:14.347 5373-5373/co.williamdev.cl V/FA: onActivityCreated
09-17 18:31:14.348 5373-5404/co.williamdev.cl V/FA: Using measurement service
09-17 18:31:14.349 5373-5404/co.williamdev.cl V/FA: Connecting to remote service
09-17 18:31:14.421 5373-5373/co.williamdev.cl I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
09-17 18:31:14.421 5373-5373/co.williamdev.cl I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6
09-17 18:31:14.424 5373-5373/co.williamdev.cl W/zygote: Skipping duplicate class check due to unrecognized classloader
09-17 18:31:14.449 5373-5373/co.williamdev.cl W/zygote: Skipping duplicate class check due to unrecognized classloader
09-17 18:31:14.509 5373-5380/co.williamdev.cl W/zygote: Suspending all threads took: 37.690ms
09-17 18:31:14.595 5373-5394/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
09-17 18:31:14.679 5373-5412/co.williamdev.cl D/NetworkSecurityConfig: No Network Security Config specified, using platform default
09-17 18:31:14.837 5373-5404/co.williamdev.cl V/FA: Using measurement service
09-17 18:31:14.837 5373-5404/co.williamdev.cl V/FA: Connection attempt already in progress
09-17 18:31:14.838 5373-5404/co.williamdev.cl V/FA: Activity resumed, time: 1920104
09-17 18:31:14.871 5373-5414/co.williamdev.cl D/OpenGLRenderer: HWUI GL Pipeline
09-17 18:31:14.903 5373-5373/co.williamdev.cl D/MainActivity: onAuthStateChanged:signed_in:RY1vRHRecNN6qMbgw0h9bcxAEnj2
09-17 18:31:15.084 5373-5378/co.williamdev.cl I/zygote: Do partial code cache collection, code=25KB, data=24KB
09-17 18:31:15.087 5373-5378/co.williamdev.cl I/zygote: After code cache collection, code=24KB, data=24KB
09-17 18:31:15.087 5373-5378/co.williamdev.cl I/zygote: Increasing code cache capacity to 128KB
09-17 18:31:15.088 5373-5378/co.williamdev.cl I/zygote: Do partial code cache collection, code=24KB, data=42KB
09-17 18:31:15.088 5373-5378/co.williamdev.cl I/zygote: After code cache collection, code=24KB, data=42KB
09-17 18:31:15.088 5373-5378/co.williamdev.cl I/zygote: Increasing code cache capacity to 256KB
09-17 18:31:15.088 5373-5378/co.williamdev.cl I/zygote: JIT allocated 71KB for compiled code of void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
09-17 18:31:15.089 5373-5378/co.williamdev.cl I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
09-17 18:31:15.167 5373-5373/co.williamdev.cl I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
09-17 18:31:15.470 5373-5414/co.williamdev.cl I/OpenGLRenderer: Initialized EGL, version 1.4
09-17 18:31:15.470 5373-5414/co.williamdev.cl D/OpenGLRenderer: Swap behavior 1
09-17 18:31:15.470 5373-5414/co.williamdev.cl W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
09-17 18:31:15.470 5373-5414/co.williamdev.cl D/OpenGLRenderer: Swap behavior 0
09-17 18:31:15.487 5373-5414/co.williamdev.cl D/EGL_emulation: eglCreateContext: 0xa4475920: maj 2 min 0 rcv 2
09-17 18:31:15.492 5373-5414/co.williamdev.cl D/EGL_emulation: eglMakeCurrent: 0xa4475920: ver 2 0 (tinfo 0xa3f24fe0)

                                                                       [ 09-17 18:31:15.584  5373: 5414 D/         ]
                                                                       SurfaceInterface::setAsyncMode: set async mode 1
09-17 18:31:15.703 5373-5373/co.williamdev.cl I/Choreographer: Skipped 38 frames!  The application may be doing too much work on its main thread.
09-17 18:31:15.760 5373-5414/co.williamdev.cl D/EGL_emulation: eglMakeCurrent: 0xa4475920: ver 2 0 (tinfo 0xa3f24fe0)
09-17 18:31:16.075 5373-5404/co.williamdev.cl D/FA: Connected to remote service
09-17 18:31:16.075 5373-5404/co.williamdev.cl V/FA: Processing queued up service tasks: 2
09-17 18:31:16.601 5373-5378/co.williamdev.cl I/zygote: Do full code cache collection, code=124KB, data=75KB
09-17 18:31:16.603 5373-5378/co.williamdev.cl I/zygote: After code cache collection, code=116KB, data=47KB
09-17 18:31:16.630 5373-5378/co.williamdev.cl I/zygote: Do partial code cache collection, code=116KB, data=53KB
09-17 18:31:16.631 5373-5378/co.williamdev.cl I/zygote: After code cache collection, code=116KB, data=53KB
09-17 18:31:16.631 5373-5378/co.williamdev.cl I/zygote: Increasing code cache capacity to 512KB
09-17 18:31:21.240 5373-5404/co.williamdev.cl V/FA: Inactivity, disconnecting from the service
09-17 18:31:22.042 5373-5378/co.williamdev.cl I/zygote: Do full code cache collection, code=249KB, data=142KB
09-17 18:31:22.042 5373-5378/co.williamdev.cl I/zygote: After code cache collection, code=154KB, data=99KB
09-17 18:31:22.510 5373-5380/co.williamdev.cl W/zygote: Suspending all threads took: 13.159ms
09-17 18:31:25.758 5373-5394/co.williamdev.cl W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.

抱歉这么长的日志,我似乎无法弄清楚这个问题。如果您发现出了问题,或者是否有我可以使用的调试过程,请告诉我。我是 Android 新手。

还有我的应用程序级别的bundle.gradle(如果有帮助的话)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "co.williamdev.cl"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        resConfigs "auto"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.android.support:design:26.0.2'
    compile 'com.android.support:support-vector-drawable:26.0.2'
    compile 'com.android.support:animated-vector-drawable:26.0.2'
    compile 'com.gelitenight.waveview:waveview:1.0.0'
    compile 'com.android.support:customtabs:26.0.2'
    compile 'com.android.support:cardview-v7:26.0.2'

    compile 'com.google.firebase:firebase-core:10.0.0'
    compile 'com.google.firebase:firebase-auth:10.0.0'
    compile 'com.google.firebase:firebase-database:10.0.0'
    compile 'com.firebaseui:firebase-ui-database:1.1.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.mxn.soul:flowingdrawer-core:2.0.0'
    compile 'com.nineoldandroids:library:2.4.0'
    testCompile 'junit:junit:4.12'
}





apply plugin: 'com.google.gms.google-services'

apply plugin: 'com.android.application'

Android Studio SDK: Google Play 服务:v44 谷歌存储库:v58

Firebase 测试实验室的 Robo 测试在加载 Firebase 数据(Galaxy S6 Edge,API 级别 22)时也没有出现任何问题

<小时/>

编辑:

好吧,我终于解决了这个问题。问题确实是过时的 Firebase 库。我将所有 Firebase 依赖项更新为最新版本(现在为 11.2.2)。

compile 'com.google.firebase:firebase-core:11.2.2'
compile 'com.google.firebase:firebase-auth:11.2.2'
compile 'com.google.firebase:firebase-database:11.2.2'
compile 'com.firebaseui:firebase-ui-database:2.3.0'

然后我得到了这些错误:

从模拟器启动 -

co.williamdev.cl E/FA: Discarding data. Failed to send app launch 
co.williamdev.cl E/FA: Failed to get app instance id 
co.williamdev.cl E/FA: Failed to send current screen to service 
co.williamdev.cl E/FA: Discarding data. Failed to send event to service 
co.williamdev.cl E/FA: Discarding data. Failed to send event to service

从真实设备启动-

? E/Zygote: v2 
? E/Zygote: accessInfo : 0

通过重新安装新的模拟器、通过我的模拟器 -> 更多(...侧边栏上的按钮)或扩展控制 -> Google Play -> 更新更新 Google Play 服务来解决。通过 SDK 管理器更新没有帮助。我还卸载了手机上现有的应用程序,因此可能清除了缓存的数据。

无论如何,谢谢大家的帮助。

最佳答案

更新:在 Firebase 控制台中检查“规则”,然后在数据库中检查。并将其更改为:

{
"rules": {

".read": true,

".write":true
  }
} 

第一篇文章

检查 Google Play 服务版本。另外,为了供功能引用,请发布您的代码。

来自Firebase

确保,

  • 运行 Android 4.0( Ice Cream Sandwich )或更高版本以及 Google Play 服务 11.2.2 或更高版本的设备
  • 来自 Google 存储库的 Google Play 服务 SDK,可在 Android SDK 管理器中获取
  • 最新版本的 Android Studio,版本 1.5 或更高版本

更新您的库

   compile 'com.google.firebase:firebase-core:11.2.2'
   compile 'com.google.firebase:firebase-auth:11.2.2'
   compile 'com.google.firebase:firebase-database:11.2.2'
   compile 'com.firebaseui:firebase-ui-database:2.3.0'

Google Play 服务:

https://play.google.com/store/apps/details?id=com.google.android.gms&hl=en

关于java - Firebase 应用程序可以在模拟器上运行,但不能在真实的 Android 设备上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46269572/

相关文章:

java - 返回给定整数的位数的递归方法

java - Unresolved Java DatePickerDialog 方法

android - 未找到 UID 10208 [安全异常] 的持久权限授予

android - 当从单独的类调用 PopupWindow 方法时,如何从 xml 文件在 PopupWindow 中定义布局

java - Spring Oauth 异常消息中的国际化

java - 将每个转换为 if else 流式传输

java - Tomcat 和 vHost 在特定子目录上失败

javascript - Node.js 中的 XML(使用 Javascript)

java - Spring MVC URL 映射

android - 优化 contentProvider 查询以检索联系人姓名和电话