我正在尝试生成我的应用程序的签名 apk,但这显示错误
Expected a name but was STRING at line 1 column 99 path $[0].apkInfo.versionName
项目级别等级为:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序级别的gradle是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
defaultConfig {
applicationId "com.roosterlogic.smartpaani.smartpaanimaintenance"
minSdkVersion 14
targetSdkVersion 25
versionCode 5
versionName "2.3"
}
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:25.1.1'
implementation 'com.android.support:design:25.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.google.android.gms:play-services-location:10.2.1'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.android.support:support-v4:25.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'id.zelory:compressor:2.1.0'
}
Android Studio 3.1 在升级过程中,我已经转向 gradle 3.1.1,但现在我从 3.0.1 退出。
此帮助背后的问题是什么。
最佳答案
重新检查您要制作 apk 的目标文件夹。如果存在现有的 apk 或 json 文件,请将其删除并重试...
关于Android Studio 在生成签名的 apk 时显示类似 "Expected a name but was STRING at line 1 column 99 path $[0].apkInfo.versionName"的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49873422/