E/FirebaseInstanceId: Google Play services missing or without correct permission. E/FirebaseInstanceId: Google Play services missing or without correct permission. E/FirebaseInstanceId: Google Play services missing or without correct permission. E/ActivityThread: Failed to find provider info for com.google.android.gms.phenotype
compileSdkVersion 29 と buildToolsVersion "29.0.0"で作成したプロジェクトをAPI 21でも動作する様に設定しエミュレータデバイスをRUNするとデバイス、プロジェクトは共に動くのですが上記のエラーがLog catに表示されました(プロジェクトのlayoutはconstraintをちゃんと設定しているのに位置やフォントが何故か部分的に崩れている。)。自身でエラーへの対応を調べbuildGradle(Module: app)のdependenciesにGoogle play servicesを追加・syncしてmanifest fileに
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>を追加したのですが以下のエラーが出現してデバイスも起動しなくなりました。どうすればエラーを解消出来るか考えあぐねているのですがアドバイスを頂けないでしょうか?
ちなみにGoogle play servicesを消して以前の状態にsyncしなおすと一番上のエラーに立ち戻ります。
使用エミュレーターデバイス - Nexus 5(API 21)
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'. > 1 exception was raised by workers: java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.android.gms.measurement.AppMeasurement found in modules classes.jar(com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.android.gms.measurement.AppMeasurement$ConditionalUserProperty found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.android.gms.measurement.AppMeasurement$Event found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.android.gms.measurement.AppMeasurement$EventInterceptor found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.android.gms.measurement.AppMeasurement$OnEventListener found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.android.gms.measurement.AppMeasurement$Param found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.android.gms.measurement.AppMeasurement$UserProperty found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.firebase.analytics.FirebaseAnalytics found in modules classes.jar (com.google.android.gms:play-services-measurement-api:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.firebase.analytics.FirebaseAnalytics$Event found in modules classes.jar (com.google.android.gms:play-services-measurement-api:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.firebase.analytics.FirebaseAnalytics$Param found in modules classes.jar (com.google.android.gms:play-services-measurement-api:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Duplicate class com.google.firebase.analytics.FirebaseAnalytics$UserProperty found in modules classes.jar (com.google.android.gms:play-services-measurement-api:17.0.0) and classes.jar (com.google.firebase:firebase-analytics-impl:12.0.1) Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
buildGrdle(Module: app)
android { compileSdkVersion 29 buildToolsVersion '29.0.0' defaultConfig { applicationId "" minSdkVersion 21 targetSdkVersion 29 versionCode 9 versionName "1.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility java_version targetCompatibility java_version } } dependencies { implementation 'com.google.android.gms:play-services:12.0.1' implementation 'com.google.firebase:firebase-core:17.0.1' implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.core:core-ktx:1.2.0-alpha02' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1' testImplementation 'junit:junit:4.13-beta-3' androidTestImplementation 'androidx.test:runner:1.3.0-alpha02' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02' } apply plugin: 'com.google.gms.google-services'
buildGrdle(Project:)
buildscript { ext.kotlin_version = '1.3.41' ext.java_version = JavaVersion.VERSION_1_8 repositories { google() jcenter() } dependencies { classpath 'com.google.gms:google-services:4.2.0' classpath 'com.android.tools.build:gradle:3.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package=""> <uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <application android:allowBackup="true" android:hardwareAccelerated="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".SecretViewController" android:screenOrientation="portrait"> </activity> <activity android:name=".HowToViewController" android:screenOrientation="portrait"> </activity> <activity android:name=".FinalViewController" android:screenOrientation="portrait"> </activity> <activity android:name=".TimerViewController" android:screenOrientation="portrait"> </activity> <activity android:name=".QuestionSystem" android:screenOrientation="portrait"> </activity> <activity android:name=".MainActivity" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <meta-data android:name="preloaded_fonts" android:resource="@array/preloaded_fonts" /> </application> </manifest>

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/29 23:02