我试图了解错误的原因。这是我做的:
compile 'com.google.android.gms:play-services:8.4.0'
添加到应用模块build.gradle
那就是它。如果我现在运行这个应用程序,它会在logcat中给我以下错误:
03-01 14:28:58.646 3133-3133/local.abc.t2 E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
03-01 14:28:58.646 3133-3133/local.abc.t2 E/GMPM: Scheduler not set. Not logging error/warn.
03-01 14:28:58.756 3133-3191/local.abc.t2 E/GMPM: Uploading is not possible. App measurement disabled
但是,如果我将com.google.android.gms:play-services:8.4.0
替换为com.google.android.gms:play-services-location:8.4.0
,则错误不再存在。
我知道play-services
版本包含多个Google Play服务API,play-services-location
仅包含位置API。因此,至少有一个其他API导致上述错误。哪一个导致哪个错误,我该如何找到?