简体   繁体   中英

Conflict with dependency 'com.android.support:support-v4'

I'm developing a mobile application with Ionic 1. I tried to build it on build.phonegap but after the compilation I faced such an error in log file. Log file contains this error:

Command finished with error code 1: /project/gradlew cdvBuildDebug,-b,/project/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true Error: /project/gradlew: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Conflict with dependency 'com.android.support:support-v4'. Resolved versions for compilation (25.4.0) and packaging (28.0.0-alpha3) differ. This can generate runtime errors due to mismatched resources.

After this error I deleted this line;

<plugin name="de.appplant.cordova.plugin.local-notification" source="npm" />

from the config file inside the www folder, and the problem was solved. But at the end, I need this plugin in my application.

PS: I searched this issue on many sources but because of phonegap I shouldn't solve this problem by changing the .gradle file.

This issue is caused by at least one other plugin in your project referencing a different version of the Android Support Library than de.appplant.cordova.plugin.local-notification .

If you were building locally, you could, as you mentioned, edit the .gradle config files manually to resolve this.

Or you could use the cordova-android-support-gradle-release plugin to automatically align the support library versions. However, this plugin relies on Cordova hook scripts which are not supported by Phonegap Build .

So to resolve this issue in the Phonegap Build environment, your only option as I see it is to fork the problematic plugins, manually align the support library versions referenced in their plugin.xml / .gradle files, and reference these forked plugins in your project's config.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM