私は自分のAndroidグーグルマップアプリにplay-service-maps-8.1.0バージョンを使用していました。それから私は新しいグーグルプレイスサービス1.0.0を追加しようとします。これで、すべてのgmsライブラリがまったく同じバージョンエラーである必要があります。グーグルの新しいサービス参照でマップサービスを見つけることができません。
implementation 'com.google.android.gms:play-services-maps:8.1.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.1'
それらのどれも一緒に動作しません
implementation 'com.google.android.libraries.places:places:1.0.0'
同じアプリで場所と地図のサービスを操作するにはどうすればよいですか?
私のすべてのgradle依存関係。
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.android.gms:play-services-maps:8.1.0'
implementation 'com.google.android.libraries.places:places:1.0.0'
}
場所を参照してください:1.0.0:それplay-services-maps:16.0.0
自体で引き込みます-
そしてplaces:1.1.0はplay-services-maps:16.1.0
。でも同じことをします。
これをルートプロジェクトに追加する必要がありますbuildscript
dependencies
:
classpath "com.google.gms:google-services:4.2.0"
これらはモジュールのJavaになりますdependencies
:
dependencies {
implementation "com.android.support:design:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
implementation ("com.google.android.libraries.places:places:1.1.0") {
exclude group: "com.android.support"
}
implementation "com.squareup.okhttp3:okhttp:3.12.1"
implementation "com.google.code.gson:gson:2.8.5"
testImplementation "junit:junit:4.12"
androidTestImplementation "com.android.support.test:runner:1.0.2"
androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"
}
apply plugin: "com.google.gms.google-services"
Placesの場合、Firebaseの依存関係やPlayサービスプラグインがない場合でも、少なくともこれら2つのstring
リソースを追加する必要があります(それでも、置換する値を含む必要なを取得するには、プロジェクトをFirebaseでセットアップする必要があります)google_services.json
)::
<?xml version="1.0" encoding="utf-8"?>
<resources>
<! -- Present in all applications -->
<string name="google_app_id" translatable="false">YOUR_GOOGLE_APP_ID</string>
<! -- Present in applications with the appropriate services configured -->
<string name="google_api_key" translatable="false">YOUR_MAPS_API_KEY</string>
</resources>
ドキュメントを参照してください。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加