When I try to generate a signed APK, I found this issue :
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.
this is my android studio details :
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
this block for signing the 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'
}
}
Solved (works for me) changing gradle version in the project build.gradle:
From this
classpath 'com.android.tools.build:gradle:3.1.1'
to this
classpath 'com.android.tools.build:gradle:3.0.1'
Per the Android Studio docs, your top-level build.gradle
ought to have the google()
repository added. Be sure to add it to the repositories
under buildscript
AND allprojects
.
The latter one is what I missed the first time I edited this today after upgrading and that led directly to a Could not find com.android.tools.lint:lint-gradle:26.1.1.
when I tried to build a release APK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With