添加 ML 套件后无法解析:com.google.android.gms:play-services:15.0.1
Failed to resolve: com.google.android.gms:play-services:15.0.1 after adding ML Kit
Look here 拜托,我尝试将 ML Kit 添加到我的应用程序构建中 gradle 但它没有 运行 完全。我想它一定来自我的 build.gradle 文件,但我不知道在哪里。请帮忙?
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
//Firebase libraries
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-ml-vision:16.0.0'
//Other Stuff
implementation 'com.firebase:geofire-android:2.3.0'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
implementation 'com.r0adkll:slidableactivity:2.0.6'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:multidex:1.0.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.android.support:support-annotations:27.1.1'
implementation 'com.google.android.gms:play-services:15.0.1'
}
下面是build.gradle(项目)。我什至包含了 google 存储库,但仍然无济于事。请帮助
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven{
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
希望这一行修复它覆盖了最近内置的版本检查
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.0'
//Google API dependencies -JACOB
implementation(project(":react-native-google-signin")){
exclude group: "com.google.android.gms" // very important excludes undeeded packages so specific ones can be grabbed
}
implementation "com.google.android.gms:play-services-base:15.0.1" // should be at least 15.0.0 to work with most recent APIS
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-identity:15.0.1"
implementation ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
//React native camera
implementation (project(':react-native-camera')) {
exclude group: "com.google.android.gms"
implementation 'com.android.support:exifinterface:25.+'
implementation ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
}
// Firebase dependencies -JACOB
implementation project(':react-native-firebase')
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-firestore:17.0.2"
implementation "com.google.firebase:firebase-database:16.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
//React Native Elements Vector Icons
implementation project(':react-native-vector-icons')
implementation project(':react-native-fbsdk')
implementation "com.facebook.react:react-native:+"
// From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'
//NEEDED TO RUN GOOGLE SIGN IN DUE TO DEPRACATED API IN GOOGLE DEPENDENCIES THAT CONFLICTS WITH NEW VERSIONS OF GRADLE -JACOB
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Google API Release Notes 表示对组合 play-services
库的支持已于 2018 年 4 月结束:
Starting with 15.0.0, there will no longer be a play-services alias
target to pull in all Google Play services components. This has been
recommended against for some time.
您不能再指定对组合 Google Play 服务目标 implementation 'com.google.android.gms:play-services:15.0.1'
的依赖。当以前的版本支持它时,它会引入所有 Google Play 库——远远超出您的需要。请参阅 Setup Guide 的 Table 1 中的 API 列表,并仅包含您的应用使用的特定 API。
检查 Google Maven Repository 确认版本 12.0.1 是组合播放服务目标的最后一个版本。
Look here 拜托,我尝试将 ML Kit 添加到我的应用程序构建中 gradle 但它没有 运行 完全。我想它一定来自我的 build.gradle 文件,但我不知道在哪里。请帮忙?
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
//Firebase libraries
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-ml-vision:16.0.0'
//Other Stuff
implementation 'com.firebase:geofire-android:2.3.0'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
implementation 'com.r0adkll:slidableactivity:2.0.6'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:multidex:1.0.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.android.support:support-annotations:27.1.1'
implementation 'com.google.android.gms:play-services:15.0.1'
}
下面是build.gradle(项目)。我什至包含了 google 存储库,但仍然无济于事。请帮助
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven{
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
希望这一行修复它覆盖了最近内置的版本检查
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.0'
//Google API dependencies -JACOB
implementation(project(":react-native-google-signin")){
exclude group: "com.google.android.gms" // very important excludes undeeded packages so specific ones can be grabbed
}
implementation "com.google.android.gms:play-services-base:15.0.1" // should be at least 15.0.0 to work with most recent APIS
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-identity:15.0.1"
implementation ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
//React native camera
implementation (project(':react-native-camera')) {
exclude group: "com.google.android.gms"
implementation 'com.android.support:exifinterface:25.+'
implementation ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
}
// Firebase dependencies -JACOB
implementation project(':react-native-firebase')
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-firestore:17.0.2"
implementation "com.google.firebase:firebase-database:16.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
//React Native Elements Vector Icons
implementation project(':react-native-vector-icons')
implementation project(':react-native-fbsdk')
implementation "com.facebook.react:react-native:+"
// From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'
//NEEDED TO RUN GOOGLE SIGN IN DUE TO DEPRACATED API IN GOOGLE DEPENDENCIES THAT CONFLICTS WITH NEW VERSIONS OF GRADLE -JACOB
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Google API Release Notes 表示对组合 play-services
库的支持已于 2018 年 4 月结束:
Starting with 15.0.0, there will no longer be a play-services alias target to pull in all Google Play services components. This has been recommended against for some time.
您不能再指定对组合 Google Play 服务目标 implementation 'com.google.android.gms:play-services:15.0.1'
的依赖。当以前的版本支持它时,它会引入所有 Google Play 库——远远超出您的需要。请参阅 Setup Guide 的 Table 1 中的 API 列表,并仅包含您的应用使用的特定 API。
检查 Google Maven Repository 确认版本 12.0.1 是组合播放服务目标的最后一个版本。