Android Studio 在生成签名的 apk 时显示类似 "Expected a name but was STRING at line 1 column 99 path $[0].apkInfo.versionName"的错误

标签 android signed-apk

我正在尝试生成我的应用程序的签名 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/

相关文章:

java - 我们如何为 android 中的 EditText 定义最小和最大自定义值之间的范围,例如 85 和 110

java - 将列表中的值附加到编辑文本处

android - 调试控制台 : Error: ADB exited with exit code 1 Performing Streamed Install. .. F

android - 找不到用于签名配置 'release' 的 keystore .-- React native

android - 无法从 Android Studio 生成签名的 apk

android - 我应该在 Android 中重写 onTouchEvent() 或 onTouchListener() 什么?

android - 暂停时 Activity 崩溃

android - 未签名的 apk 与已签名的 apk 谷歌地图不显示

android - 进程 'command ' node'' 以非零退出值 1 linux 完成,同时生成签名的 apk

android - 在我签名的 apk 中没有显示谷歌地图,需要一步一步的过程