无法从Android studio 3.1.1生成apk
作者:互联网
当我尝试生成签名的APK时,我发现了这个问题:
10:58 Generate Signed APK: Errors while building APK. You can find the errors in the ‘Messages’ view.
No cached version of com.android.tools.lint:lint-gradle:26.1.1 available for offline mode.
这是我的android studio详细信息:
Android Studio 3.1.1
Build #AI-173.4697961, built on April 4, 2018
JRE: 1.8.0_152-release-1024-b02 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
这个块用于签署apk:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseconfig
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
} signingConfigs {
releaseconfig {
keyAlias 'release_key'
keyPassword 'xxxxx'
storeFile file('xxxxxx)
storePassword 'xxxx'
}
}
解决方法:
根据Android Studio docs,您的顶级build.gradle应该添加google()存储库.请务必将其添加到buildscript AND allprojects下的存储库中.
后者是我在升级后第一次编辑今天时错过的,直接导致无法找到com.android.tools.lint:lint-gradle:26.1.1.当我试图建立一个发布APK.
标签:android,build-gradle,gradle,android-studio-3-1 来源: https://codeday.me/bug/20191005/1855121.html