2

Everything was working fine. In my application, I was using Picasso to show images and by default Picasso rotate images by 90 degrees. I wanted to replace with Glide, I tried including Glide in the project. Since then I'm getting this error even though I removed Glide from my project I can't build my project anymore. Here are my Gradles.

Project.gradle

buildscript {
repositories {
    google()
    maven {
        url "https://maven.google.com"
    }
    maven {
        url 'https://maven.fabric.io/public'
    }
    jcenter()
}
dependencies {

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.android.tools.build:gradle:3.4.2'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath 'io.fabric.tools:gradle:1.31.0'
}

}

allprojects {
repositories {
    google()
    maven { url "https://maven.google.com" }
    maven { url "https://jitpack.io" }
    jcenter()
}


}


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

App.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "xxx"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 40
        versionName "0.0.97"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions
            {
                sourceCompatibility JavaVersion.VERSION_1_8
                targetCompatibility JavaVersion.VERSION_1_8
            }
    dexOptions {
        javaMaxHeapSize "8g"
    }
    useLibrary 'org.apache.http.legacy'
}

repositories {
    maven { url "https://jitpack.io" }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    implementation 'com.google.firebase:firebase-inappmessaging-display:18.0.1'
    implementation 'com.google.firebase:firebase-dynamic-links:18.0.0'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'gun0912.ted:tedpermission:2.2.2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.github.BlacKCaT27:CurrencyEditText:2.0.2'
    implementation 'com.github.CardinalNow:Android-CircleProgressIndicator:v0.2'
    implementation 'com.txusballesteros:FitChart:1.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Please help.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Faisal
  • 705
  • 3
  • 16

3 Answers3

0

Try this: Go To File >> Invalidate caches and restart.

If it doesn't help, then try that manually like this:

Close Android Studio

Go to C:\Users\UserName\.android and rename:

  • build-cache folder to build-cache.bak

Go to C:\Users\UserName\.AndroidStudio3.4.2\system and rename these folders:

  • caches to caches.bak

  • compiler to compiler.bak

  • compile-server to compile-server.bak

  • conversion to conversion.bak

  • external_build_system to external_build_system.bak

  • frameworks to frameworks.bak

  • gradle to gradle.bak

  • resource_folder_cache to resource_folder_cache.bak

Open the Android Studio and open your project again. Hope it helps.

Farhan Ibn Wahid
  • 926
  • 1
  • 9
  • 22
  • you put the same answer on other question. – Om Infowave Developers Aug 02 '19 at 04:33
  • Yes I did, this is an app cache issue. The main reason is unknown to me but you can see it in many questions like this https://stackoverflow.com/questions/42477738/rendering-problems-note-one-or-more-layouts-are-missing-the-layout-width-or-lay/53061004#53061004 please go through the whole question and all the answers. I am sure you will understand the problem. – Farhan Ibn Wahid Aug 02 '19 at 04:39
  • what does it say when you try to build it ? – Farhan Ibn Wahid Aug 02 '19 at 04:43
  • this: `Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'` – Faisal Aug 02 '19 at 04:49
  • 1
    @Psycho I disabled instant run ages ago because of issues it creates. – Faisal Aug 02 '19 at 04:57
  • what about deleting all files inside \system\caches then open project and sync? – Farhan Ibn Wahid Aug 02 '19 at 04:59
  • When you replied to @OmInfowaveDevelopers that link in your comment I went to that thread and already tried deleting all files in system\cache and it didn't work. – Faisal Aug 02 '19 at 05:04
  • last option that I know of, copy your code, save into some files, uninstall (remove settings also) and re-install again. Otherwise it's beyond our imagination – Farhan Ibn Wahid Aug 02 '19 at 05:06
  • @Psycho Uninstall what? – Faisal Aug 02 '19 at 05:10
  • I'm sorry @Psycho but I don't think so I'm going to do because its an error, there has to be a solution for it. But I appreciate your help. – Faisal Aug 02 '19 at 05:28
  • I understand, hope someone comes with correct solution – Farhan Ibn Wahid Aug 02 '19 at 05:30
  • found solution:[link](https://stackoverflow.com/questions/46505695/execution-failed-for-taskappprocessdebugmanigest) see accepted answer. I don't know when but I included `implementation 'com.google.firebase:firebase-inappmessaging-display:18.0.2'` do display firebase messages. then I stopped using it and removing this solved it. – Faisal Aug 02 '19 at 05:39
0

1- Add this

android {
      defaultConfig {
        multiDexEnabled true
        }
   }
  • sync project
  • Clean
  • build
Imran Ali
  • 321
  • 2
  • 13
0

Try adding these two dependencies and let me know,

implementation "android.arch.core:runtime:1.1.0"
implementation "android.arch.core:common:1.1.0"
Manoj Perumarath
  • 9,337
  • 8
  • 56
  • 77