Hii dev, dulu saat saya bergonta ganti sistem operasi, seringkali saya menemui kesalahan semacam ini.
Saat menghasilkan signed apk dari studio android mendadak terjadi kesalahan padahal di OS sebelumya normal. Beberapa hari kemudian semuanya berfungsi dengan baik.
Suatu ketika, di lain kesempatan sekitar 2 minggu setelahnya, saya juga menghadapi masalah serupa setelah mencoba menginstall ulang OS Linux saya.
Error tersebut berbunyi seperti ini.
FAILURE: Build failed with an exception. What went wrong:
A problem was found with the configuration of task ':app:packageRelease'. File '/media/user86/data/MySIPonline/app/build/intermediates/res/resources-release-stripped.ap_' specified for property 'resourceFile' does not exist.
Saya coba memeriksa folder itu dan file release-stripped.ap ada di dalamnya. Saya tidak dapat menemukan kesalahannya berarti.
Ini adalah build.gradle
project saya kala itu.
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxxxxxxxxx"
minSdkVersion 14
targetSdkVersion 23
versionCode 15
versionName "1.5.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2048M"
}}
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/paynimo_v2.0_live.jar')
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
transitive = true;
}
compile files('libs/paynimo.scanner.jar')
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
}
apply plugin: 'com.google.gms.google-services
Mohon dibantu terimakasih.
Pencerahan
Ikuti langkah-langkah di bawah ini untuk menghapus kesalahan Anda
- Step 1 : - Clean your project
- Step 2 : - Rebuild your project
- Step 3 : - Invalidate and Restart Android Studio
- Step 4 : - Edit build.gradle with below code
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Hapus saja - baris ini shrinkResources false
Beres!