gpt4 book ai didi

android - 未能解决所有 Google 依赖项

转载 作者:行者123 更新时间:2023-12-03 05:43:58 26 4
gpt4 key购买 nike

我在我的个人计算机上打开了我的工作项目,Gradle 构建无法解决所有 Google 依赖项(支持库、firebase、gms 等),我同时拥有 google()url "https://maven.google.com"在我的 gradle 文件中,我实际上放在了经过多次尝试找出问题所在的任何地方。 Gradle 给了我这个错误

Failed to resolve: cardview-v7
Open File

Failed to resolve: design
Open File

Failed to resolve: recyclerview-v7
Open File

Failed to resolve: percent
Open File

Failed to resolve: play-services-maps
Open File

Failed to resolve: firebase-messaging
Open File

Failed to resolve: firebase-invites
Open File

Failed to resolve: play-services-appinvite
Open File

Failed to resolve: firebase-analytics
Open File

Failed to resolve: firebase-iid-interop
Open File

Failed to resolve: firebase-common
Open File

Failed to resolve: play-services-tasks
Open File

Failed to resolve: firebase-measurement-connector
Open File

Failed to resolve: play-services-stats
Open File

Failed to resolve: support-v4
Open File

Failed to resolve: transition
Open File

Failed to resolve: appcompat-v7
Open File

Failed to resolve: support-fragment
Open File

Failed to resolve: animated-vector-drawable
Open File

Failed to resolve: support-core-ui
Open File

Failed to resolve: support-vector-drawable
Open File

Failed to resolve: support-annotations
Open File

如果有人需要,我会发布我的 gradle 文件,知道这可能是什么吗?我的其他项目工作正常,只有这个有问题。同样昨天在我的工作计算机上一切正常,之间没有对代码进行任何更改

编辑

build.gradle(项目:MyApp)
apply plugin: 'com.github.ben-manes.versions'

buildscript {
ext.kotlin_version = '1.2.30'
repositories {
jcenter()
google()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'

classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath "io.realm:realm-gradle-plugin:4.3.0"
classpath 'com.google.gms:google-services:3.2.1'


classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

build.gradle(模块:应用程序)
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
apply from: '../dependencies.gradle'


android {

compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
applicationId "com.app.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 30

versionName "1.2.2"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
signingConfig signingConfigs.config
}
buildTypes {
debug {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
lintOptions {
abortOnError false
}
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
// Remove unneeded Realm native libs (nearly no devices use these)
exclude 'lib/mips/librealm-jni.so'
// comment the following line out and clean project, if you want to
// test the app in an emulator/x86 device
//exclude 'lib/x86/librealm-jni.so'
//exclude 'lib/x86_64/librealm-jni.so'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}


repositories {
jcenter()
google()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.fabric.io/public' }

maven {
url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
}
maven {
url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
}
maven { url "https://api.bitbucket.org/1.0/repositories/touchartsro/maven-public/raw/releases" }
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:multidex:1.0.3'
annotationProcessor "com.google.dagger:dagger-compiler:${daggerVersion}"
implementation "com.google.dagger:dagger:${daggerVersion}"

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation "com.android.support:cardview-v7:${supportLibVersion}"
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:cardview-v7:${supportLibVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
implementation "com.android.support:design:${supportLibVersion}"
implementation "com.android.support:percent:${supportLibVersion}"
implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
implementation "com.squareup.okhttp3:okhttp:${okHttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}"
implementation 'io.realm:android-adapters:2.1.0'
implementation "org.parceler:parceler-api:${parcelerVersion}"
annotationProcessor "org.parceler:parceler:${parcelerVersion}"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.0@aar') {
transitive = true;
}
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.jakewharton.timber:timber:4.6.0'
implementation 'io.jsonwebtoken:jjwt:0.7.0'
implementation('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
implementation 'io.reactivex:rxjava:1.2.1'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava-async-util:0.21.0'
implementation 'com.jakewharton.rxbinding:rxbinding:0.3.0'
implementation 'com.trello:rxlifecycle:0.4.0'
implementation 'com.trello:rxlifecycle-components:0.4.0'
implementation 'com.facebook.android:facebook-android-sdk:4.23.0'
implementation 'org.twitter4j:twitter4j-core:4.0.4'
implementation 'com.facebook.stetho:stetho:1.4.1'
implementation 'com.uphyca:stetho_realm:2.1.0'
implementation 'com.facebook.fresco:fresco:1.8.1'
implementation 'com.facebook.fresco:animated-gif:1.5.0'
implementation 'com.facebook.fresco:animated-webp:1.5.0'
implementation 'com.facebook.fresco:webpsupport:1.5.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-invites:16.0.0'
implementation 'net.danlew:android.joda:2.9.9'
implementation 'com.aurelhubert:ahbottomnavigation:2.2.0'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'org.sufficientlysecure:html-textview:3.5'
implementation 'com.github.mukeshsolanki:country-picker-android:1.1.9'
implementation 'net.opacapp:multiline-collapsingtoolbar:1.5.0'
implementation 'me.zhanghai.android.materialratingbar:library:1.1.0'
implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
implementation 'me.postaddict:instagramscraper:1.0.0'


implementation project(':card-fold')

//implementation project(':fcell')
//implementation project(':kotlin-utils')

implementation 'cz.touchart:kotlin-utils:0.1.6'

implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
compileOnly 'javax.annotation:jsr250-api:1.0'
}

apply plugin: 'com.google.gms.google-services'

build.gradle(模块:other_moduke)
buildscript {
repositories {

google()
maven {
url "https://maven.google.com"
}
jcenter()

}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: '../dependencies.gradle'

android {
compileSdkVersion 27

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:appcompat-v7:$supportLibVersion"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
}

依赖项.gradle
ext.kotlinVersion = '1.2.30'
ext.supportLibVersion = '27.1.0'

ext.retrofitVersion = '2.3.0'
ext.okHttpVersion = '3.8.1'
ext.daggerVersion = '2.11'
ext.parcelerVersion = '1.1.9'

最佳答案

更新 谷歌服务 从:

classpath 'com.google.gms:google-services:3.2.1'

到:
classpath 'com.google.gms:google-services:4.0.1'

关于android - 未能解决所有 Google 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51100575/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com