Error :- Execution failed for task ':app:dexDebug' in android studio

后端 未结 4 1788
灰色年华
灰色年华 2020-12-17 18:24

I newly Android project started a new default project. Everytime I try to start the app this error occurs:

build.gradle(Module:app)

apply plugin: \'c         


        
相关标签:
4条回答
  • 2020-12-17 18:34

    Probably you dont add suport-v4 library correctly in your project.
    Check this :

    1. you have add this library to all modules that need it (If you have more than module in your project like main module and library module).
    2. Check that you dont add this library twice.

    Finally if this didn't resolve your problem try to remove this library from your imported libraries list and your project modules dependency list and import and add it again from one source to your project , then try rebuild the project or restart the IDE.
    I hope this way can help you :)

    0 讨论(0)
  • 2020-12-17 18:34

    The log trace have said: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;. This is caused by some caches. Not anything wrong with your codes. You just need to rebuild Project or clean Project, then everything would be fine.

    0 讨论(0)
  • 2020-12-17 18:41

    This problem is not because of JDK 1.8 or 1.7, Its due to dependencies. Please check your Gradle Dependencies.

    I have faced similar issue, in my case the problem was occurred due to Facebook dependency

    dependencies { ... ... ... ... ... //Commented the following one compile 'com.facebook.android:facebook-android-sdk:4.0.0' } after commenting the above line everything was normal

    0 讨论(0)
  • 2020-12-17 18:51

    This kind of issue happens when your are using the same library with a different version.

    Remove from your libs folder the supportv4.jar and add this line in the build.gradle file:

    compile 'com.android.support:support-v4:21.0.3'
    
    0 讨论(0)
提交回复
热议问题