Closed rishabhmathur1693 closed 6 years ago
The same error is happening to me. Apparently, a new version of the com.android.support:support-v4
library was released, and the plugin defines com.android.support:support-v4:+
as framework in plugin.xml
. The +
sign means that it will get the latest version (28.0.0
), which seems seems to be incompatible with other plugins. The problem may be solved specifying at least a major version (com.android.support:support-v4:27.+
) instead.
I was able to build a development version by changing all the plugin dependencies from com.android.support:support-v4:+
to com.android.support:support-v4:27.1.0
. After that, I executed ionic cordova platform remove android
and ionic cordova platform add android
.
Thank you so much @aamatte . You really saved me today. I've spent whole night researching this issue.
plugin.xml can be found in platforms-->android-->project.properties
This will help to find xml file to remove that error
Is not necessary to remove and add the android platform... just rebuild with --clean , after changing the com.android.support:support-v4:+ to com.android.support:support-v4:27.+ . in the project.properties file as described before by aamatte .
I'd like to inform that to me only worked when I removed and added it again.
Same issue, but the workaround does not work.
My platforms-->android-->project.properties
is generated automatically by gradle and looks like this:
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.gradle.include.1=cordova-plugin-crosswalk-webview/creo2storetablet994666-xwalk.gradle
cordova.system.library.2=com.google.android.gms:play-services-analytics:+
cordova.gradle.include.2=cordova-plugin-ignore-lint-translation/creo2storetablet994666-build-extras.gradle
As you can see com.android.support:support-v4:24.1.1+
is asked to be installed (i.e., not v28).
However, after running ionic cordova build android
I see in a build file /platforms/android/build/intermediates/blame/res/armv7/debug/multi/values-af.json:
that com.android.support:support-v4:28 seems to be installed:
34 "from": {
35: "file": "/my-app/platforms/android/build/intermediates/exploded-aar/com.android.support/coordinatorlayout/**28.0.0-alpha1**/res/values/values.xml",
36 "position": {
37 "startLine": 2,
..
318 },
The issue persist when removing android, and even after completely resetting and reinstalling the whole repo.
Any idea why the specification in project.properties is ignored, and how to avoid installation of com.android.support:support-v4 version 28.0.0-alpha1 ?
Ok, my problem is solved when uninstalling the crosswalk plugin (that i needed for older devices)
@robindierckx I am getting this error in an Ionic project too - what did you do, just change the project.properties file as per the earlier comments? I don't understand because that file then disappears when you uninstall the android platform and add it again?
@richardshergold You are right. The project.properties
file is generated by /platforms/android/cordova/lib/builders/GradleBuilder.js
, which is erased when uninstalling the platform. If you don't uninstall the platform though, you can modify your project.properties file searching for com.android.support in GradleBuilder.js, change the version, and then rebuild with --clean.
In my case the version in project.properties was still ok, and the issue came from the fact that for some reason the crosswalk plugin pulled the buggy version of com.android.support:support-v4
. Removing crosswalk reverted that plugin to an earlier version and removed the bug.
PS: In fact, I don't even have the cordova-plugin-file-opener2 plugin... So this is a more general cordova bug appearing in many plugins.
Install this plugin to fix this issue.
ionic cordova plugin add cordova-android-support-gradle-release --save
https://github.com/dpa99c/cordova-android-support-gradle-release
thanks sreekanth, this works for me
My problem was crosswalk-webview plugin
my project.properties was automatically set to com.android.support:support-v4:24.1.1+
and it works fine after removing crosswalk-webview.
Still KO for me...2 days ago my project built fine, and since this morning without touch anything, build is KO with this error. crosswalk-webview plugin is not installed in my project, i tried all the solutions mentioned here and nothing works... I don't understand... Changing to com.android.support:support-v4:24.1.1+ don't do anything
[EDIT] I finally found the solution ! I work with Ionic framework, so the solution was to do this :
cordova plugin rm cordova-plugin-compat --force
cordova platform rm android
ionic cordova platform add android@6.3.0
According to that topic : android-build-broken-after-gradle-dependencies-update
Same Situation here like gsoulie said.
Same error fixed
plaforms/android/project.properties
file fixed.
before
...
...
cordova.system.library.2=com.android.support:support-v4:+
after
...
...
cordova.system.library.2=com.android.support:support-v4:27.1.0
@aamatte thx
I had to go to v4:26.+ for some reason to make it work. Doing 'cordova platform add android@6.3.0' worked too but seemed like a bigger change
I'm using crosswalk plugin, and i solved the problem only by using of @sreekanth-karini tip. running command cordova plugin add cordova-android-support-gradle-release --save
I'm not using ionic.
cordova plugin add cordova-android-support-gradle-release --save it does not help. Issue is still existing.
For me, it works with cordova-android version 6.3.0.
ionic cordova platform remove android --save
and ionic cordova platform add android@6.3.0 --save
.
when i import this library compile 'com.facebook.android:facebook-core:4.36.1' compile 'com.facebook.android:facebook-marketing:4.36.1' after gradle procces when i run found an error
ERROR: In
I was running into this issue with react native and it was caused by the following lines in my android/app/build.gradle
:
implementation ("com.google.android.gms:play-services-base:+") {
force = true;
}
implementation ("com.google.android.gms:play-services-maps:+") {
force = true;
}
etc...
Apparently this + resolved to a new 17.0.0 version which broke my build.
Changing the + to 16.0.0 (or 16.0.1 for play-services-base) solved my issue
I'm getting these two errors while compiling for the Android platform -
Can anyone please help me figure out why this could be happening?
When I remove this plugin, build process succeeds.