大约34小时前我生成了一个签名的apk但现在,我无法生成签名的Apk,我不知道如何解决这个问题。请帮忙
这是我的输出消息
错误:注意:有11个重复的类定义。 (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)FAILURE:构建失败,但有例外。
- 出了什么问题:任务执行失败':app:lintVitalRelease'。 无法解析配置':app:lintClassPath'的所有文件。无法解析com.android.tools.lint:lint-gradle:26.1.0。要求:project:app无法解析com.android.tools.lint:lint-gradle:26.1.0。无法获得资源'https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.0/lint-gradle-26.1.0.pom'。无法获得'https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.0/lint-gradle-26.1.0.pom'。 jcenter.bintray.com:提供了nodename或servname,或者未知无法解析com.android.tools.lint:lint-gradle:26.1.0。无法获得资源'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/26.1.0/lint-gradle-26.1.0.pom'。无法获得'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/26.1.0/lint-gradle-26.1.0.pom'。 dl.google.com:提供了nodename或servname,或者未知
- 尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获得完整的见解。
- 在https://help.gradle.org获得更多帮助
在10s内建立失败
这是我的build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.myapp……"
minSdkVersion 17
targetSdkVersion 26
versionCode 5
versionName "5.0"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation "com.android.support:support-v4:$support_version"
implementation "com.android.support:cardview-v7:$support_version"
implementation "com.android.support:recyclerview-v7:$support_version"
implementation "com.google.firebase:firebase-core:$firebase_version"
implementation "com.google.firebase:firebase-messaging:$firebase_version"
implementation "com.google.firebase:firebase-ads:$firebase_version"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.1'
implementation "com.google.firebase:firebase-perf:$firebase_version"
implementation 'io.github.yavski:fab-speed-dial:1.0.6'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.codemybrainsout.rating:ratingdialog:1.0.8'
implementation 'com.android.billingclient:billing:1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'org.jsoup:jsoup:1.10.3'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android-extensions'
这是我的build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.10'
ext.support_version = '26.1.0'
ext.firebase_version = '12.0.1'
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'io.fabric.tools:gradle:1.25.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是一个lintValidRelease问题。您需要在Gradle文件中添加lintOptions。
android {
..
lintOptions {
checkReleaseBuilds false
}
}
对我来说问题是由于allproject
部分缺少存储库:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
}
allprojects {
...
repositories {
mavenCentral()
google()
jcenter()
}
}
在我添加了google()
和jcenter()
后,该项目现已成功构建