Google Play開発者サービス15.0.2をインストールしたい場合(15.0.0がデキシングエラーを作成するため、理由はわかりません)gradleから次のエラーが発生します:
Failed to resolve: com.google.android.gms:play-services-location:15.0.2
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-basement:15.0.2
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-tasks:15.0.2
Install Repository and sync project
Open File
Show in Project Structure dialog
しかし、これらの依存関係をbuild.gradleに入れたことはありません。インストールボタンでインストールしたい場合、エラーが発生します:依存関係が見つかりませんでした
これは私のbuild.gradleファイルです:
apply plugin: 'com.android.library'
def DEFAULT_COMPILE_SDK_VERSION = 25
def DEFAULT_BUILD_TOOLS_VERSION = "25.0.2"
def DEFAULT_TARGET_SDK_VERSION = 25
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "15.0.2"
android {
compileSdkVersion project.hasProperty('compileSdkVersion') ?
project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion project.hasProperty('buildToolsVersion') ?
project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 16
targetSdkVersion
project.hasProperty('buildToolsVetargetSdkVersionrsion') ?
project.buildToolsVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
}
}
repositories {
mavenCentral()
}
dependencies {
def googlePlayServicesVersion =
project.hasProperty('googlePlayServicesVersion') ?
project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.facebook.react:react-native:+'
compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
compile "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"
compile 'me.leolin:ShortcutBadger:1.1.17@aar'
}
編集:私は自分の問題を解決することに成功しました。実際、親のbuild.gradleにmultidexスクリプトがあり、すべてのcom.gms.googleを15.0.2に強制的に更新しましたが、おっしゃるように、GooglePlay開発者サービスには15.0.2がありません。このスクリプトを削除したところ、機能しました
Firebaseライブラリには、以前に共有していた同じバージョンとは対照的に、独立したバージョンがあります。こちらをご覧ください。したがって、これは現在機能していますが、将来は異なる可能性があります。
implementation "com.google.firebase:firebase-core:$googlePlayServicesVersion"
implementation "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"
さらに重要なことに、FirebaseライブラリのバージョンはGoogle Play開発者サービスのライブラリと同じではなくなりました。場所などのPlay開発者サービスライブラリのバージョン15.0.2はありません。ここを参照してください。最新は、15.0.0です。
私のアドバイスは、各ライブラリを個別に定義することです。
問題を解決するには、これを変更します。
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "15.0.0"
この:
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-messaging:15.0.2"
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加