My android application using Kotlin is throwing this exception when I try to Run \'app\' in the emulator o in my cellphone. When I build my project it runs well, with no err
I've tried all solutions and non of them helped! finally after many trying, I figured it out, just follow the tips:
yourProject/app/
MYAPP_RELEASE_STORE_FILE=KEYSTROK_NAME
MYAPP_RELEASE_KEY_ALIAS=KEY_ALIAS
MYAPP_RELEASE_STORE_PASSWORD=R_PASS
MYAPP_RELEASE_KEY_PASSWORD=K_PASS
android.enableR8=true
app level build.gradle (inside android):
signingConfigs{
release{
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}
release {
manifestPlaceholders = [analytics_deactivated: "false"]
minifyEnabled true
signingConfig signingConfigs.release
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
mac: ./gradlew clean assemble_YOUR_FAVOR_Release
win: gradlew clean assemble_YOUR_FAVOR_Release
where _YOUR_FAVOR_
is your optional favor, if you are not using any favor, just simply use assembleRelease
instead of assemble_YOUR_FAVOR_Release
Generate Signed APK for debug, and then you can generate signed APK for release.
All the solutions didn't work with me
Android Studio V 3.5
Android gradle plugin V 3.4.2
Gradle Version V 5.1.1
Reference
I've tried many things to solve the issue, but nothing helped. I get this error when trying to generate a signed apk.
Downgrading to older versions of Android Studio helped (3.4.2) worked, however this is not the solution.
The 'Clean Project' function in AS does not clean the place where your generated apk is created and there is one file that may be blocking the whole procedure: output.json
Try removing output.json from .../app/projectname/release/output.json
the only solution that works for me is using in my root gradle
classpath 'com.android.tools.build:gradle:3.3.0'
what i've tried : - clear all build folder manually - invalidate cache but none of these is work
PS: i'm using android studio 3.5 btw
Update :
just like @Vishrut Mavani, changing the destination folder of your release version is work
This issue happens after update my Android studio v3.4 to v3.5 Now, it is working fine
I fixed this issue by deleting debug/output.json and release/output.json files
Android Studio 3.5 compilesdkVersion 28
apk generating working