gpt4 book ai didi

android - 错误 : Could not parse the Android application Module's Gradle Config

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:55:25 24 4
gpt4 key购买 nike

我一直在尝试在我的 Android 项目中设置 Firebase。问题是,我遇到了这个错误:

Could not parse the Android application Module's Gradle Config

而且我真的解决不了。

我见过很多人遇到这个错误,但他们似乎可以通过升级构建工具版本或更新 google-services 来解决这个问题。我已经完成了所有这些工作,但到目前为止还没有成功。

这是我的 Gradle 脚本:

apply plugin: 'com.android.application'

android {
signingConfigs {
AndroidAppPro {
}
}
compileSdkVersion 25
buildToolsVersion '26.0.0'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.critizr.pro"
minSdkVersion 14
targetSdkVersion 25
versionCode 9
versionName "1.5.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
preprod {
applicationId "com.cr.pro"
buildConfigField 'boolean', 'IS_PROD', 'false'
buildConfigField 'String', 'HOST', '"https://myurl.com/"'
}
prod {
applicationId "com.cr.pro"
buildConfigField 'boolean', 'IS_PROD', 'true'
buildConfigField 'String', 'HOST', '"https://myurl/"'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}

dependencies {
compile project(':lib-viewflow')

// new libs
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'

compile 'com.google.android.gms:play-services-gcm:11.0.2'
compile 'com.google.android.gms:play-services-maps:11.0.2'
//compile 'com.google.android.gms:play-services-analytics:11.0.1'

compile 'org.apache.httpcomponents:httpclient:4.1'
compile 'org.apache.httpcomponents:httpmime:4.1'

compile 'com.joshdholtz.sentry:sentry-android:1.5.0'
compile 'com.borax12.materialdaterangepicker:library:1.6'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.cloudinary:cloudinary-core:1.2.2'
compile 'com.cloudinary:cloudinary-android:1.2.2'
compile 'com.loopj.android:android-async-http:1.4.5'
}
apply plugin: 'com.google.gms.google-services'

第二个:

 buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}

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

最佳答案

对我来说,删除 jCenter 的警告有效

jCenter()  remove it..

关于android - 错误 : Could not parse the Android application Module's Gradle Config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45279479/

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