如何解决为什么每次生成一个APK时都收到重复输入错误?
我正在尝试为我的应用程序生成一个单独的APK,但是我不知道自己的构建文件出了什么问题,我在消息视图中收到以下错误消息: 原因::重复输入:注意 我进行了很多搜索,以了解为什么会发生这种情况,但徒劳
任何帮助将不胜感激:)
这是我的构建(Module:app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.naturesounds"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs',include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-ads:19.4.0'
implementation 'com.android.tools.lint:lint-gradle:26.6.1'
}
这是我的构建(项目):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
更新: 我查看了我的项目库,发现许多NOTICE文件,它们可能会导致此问题吗?
解决方法
那是因为您的项目在release文件夹中有多个release apk。
转到您的项目-应用-构建-输出-apk-
在这里您将看到debug和release文件夹。
转到释放文件夹并从中删除所有数据。现在在Studio中清理..rebuild项目并生成签名的APK。
,我评论了build.gradle的最后一行 (Module:app)是: 实施'com.android.tools.lint:lint-gradle:26.6.1'
尽管我第一次尝试对APK进行签名时遇到错误,但仍解决了问题,也许@Prajwal Waingankar提到的解决方案对此有所帮助
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。