本文介绍了预期名称,但在第1行第99列路径$ [0] .apkInfo.versionName处为STRING的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级到gradle到3.1.1,但现在我想再次更改为3.0.1,但在更改为3.0.1后,我收到此错误

I upgraded to gradle to 3.1.1 but now i want to change again to 3.0.1 but after changing to 3.0.1 i am getting this error

使用3.0.1之前,它是完美的工作,但我更改后的Android Studio更新。

I was using 3.0.1 before and it was working perfectly but i changed after android studio update.

错误只是在生成签名apk时才会发生。

The error is only coming when generating signed apk.

Project Gradle

Project Gradle

buildscript {

repositories {
    google()
    jcenter()
}
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 {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

应用程序gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.smiles.smartstuddy"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 4
    versionName "1.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'dev.dworks.libs:volleyplus:+'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'commons-io:commons-io:2.4'
compile 'com.github.bumptech.glide:glide:4.6.1'
compile 'es.voghdev.pdfviewpager:library:1.0.3'
 }


推荐答案

我在同一个用例中得到了同样的错误,并且修复了这个错误,我清理并重建了该项目。

I was getting the same error in the same use case and what fixed it for me was to clean and rebuild the project.

这篇关于预期名称,但在第1行第99列路径$ [0] .apkInfo.versionName处为STRING的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 04:42