Cordova - Multiple dex files define (annotation)

后端 未结 5 1053
别那么骄傲
别那么骄傲 2020-12-11 18:59

I\'m working on a project with ionic. After I installed the Facebook Plugin I\'m not able to build the project for android anymore!

The command

ionic         


        
相关标签:
5条回答
  • 2020-12-11 19:17

    Adding this to project.properties will resolve all of the V4 error instances.

    cordova.system.library.7=com.android.support:appcompat-v7:27.1.0
    
    0 讨论(0)
  • 2020-12-11 19:19

    i solved same problem in my app the problem is

     com.android.support:support-v4:+
    

    com.android.support:support-v4:+ file exist in /platforms/android/phonegap-facebook-plugin/Myapp-FacebookLib/libs

    if you want only used facebook and Push Notification Plugin then simply commit the line in project.properties

    #cordova.system.library.1=com.android.support:support-v4:+
    

    Best way to solved this problem

    1 First delete the android-support-v4.jar from /platforms/android/phonegap-facebook-plugin/Myapp-FacebookLib/libs
    
    2 second step create a file name build-extras.gradle in /platforms/android/phonegap-facebook-plugin/Myapp-FacebookLib/
    

    and type in file

    dependencies {
    compile "com.android.support:support-v4:+" }
    
    0 讨论(0)
  • 2020-12-11 19:27

    Push- and Facebook Plugins are conflicting by using different versions of android support libraries.

    See my answer to this question: Android Studio cordova Push plugin

    0 讨论(0)
  • 2020-12-11 19:29

    Multiple dex files error is raised because of using multiple support jar files in the ionic / cordova project

    you need to change build.gradle under platforms/android

    find the below line

    apply plugin:'com.android.application'
    

    after add these below lines

    configurations {
       all*.exclude group: 'com.android.support', module: 'support-v4'
    } 
    
    0 讨论(0)
  • 2020-12-11 19:35

    We had the same problem with Google Analytics plugin with One Signal plugin and finally it was resolved by installing the plugins in different order;

    1. first install Google Analytics
    2. and then One Signal plugin, if you install in reverse order you will get that error.

    This was our config:

    • Cordova CLI: 7.0.1
    • Ionic Framework Version: 3.3.0
    • Ionic CLI Version: 2.2.1
    • Ionic App Lib Version: 2.2.0

    Cheers!

    0 讨论(0)
提交回复
热议问题