pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 584 forks source link

com.android.support v4 update breaks the plugin for Android #199

Closed JuanjoPP closed 5 years ago

JuanjoPP commented 6 years ago

Hello,

The problem is described here: https://stackoverflow.com/questions/49162538/cordova-build-android-unable-to-find-attribute-androidfontvariationsettings-a

Seems like leaving this line: <framework src="com.android.support:support-v4:+" />

in the plugin.xml file left the plugin exposed to a breaking change in the com.android.support library, which causes the build to fail.

Setting it to version 27.1.0 before adding the platform seems to work locally, so if someone could please merge pull request #198 over here it would save us all a bit of a headache.

natanielpaiva commented 6 years ago

Please, please! I alson need...

JuanjoPP commented 6 years ago

I've set up a fork in the meantime. Deleting the original plugin,. using cordova plugin add https://github.com/JuanjoPP/cordova-plugin-file-opener2 and reinstalling the platform should do the trick.

caoguanjie commented 6 years ago

Will the author fix it? @JuanjoPP What changes have you made in your branch?It can be said concretely!

JuanjoPP commented 6 years ago

https://github.com/JuanjoPP/cordova-plugin-file-opener2/commit/96e394315b926e7787e30cf348d1b9dfd5a653c4

MauroRomer commented 6 years ago

@JuanjoPP After I applied your fork I am receiving this erro:

Error: /Projects/Cordova/WalterTuche - TESTE/platforms/android/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. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

Can you help me?

Tks

JuanjoPP commented 6 years ago

https://github.com/phonegap/phonegap-plugin-push/issues/2229#issuecomment-369510785

After a cursory google search, It seems that you may be using a plugin forcing cordova android support to 26, which crashes with this. You'll probably have to use your own fork/local plugin for this one, or use the original and force build.gradle to resolve to whatever version you're using.

El 10 mar. 2018 6:34 a. m., "MauroRomer" notifications@github.com escribió:

@JuanjoPP https://github.com/juanjopp After I applied your fork I am receiving this erro:

Error: /Projects/Cordova/WalterTuche - TESTE/platforms/android/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. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v13/view/ DragAndDropPermissionsCompat.class

Can you help me?

Tks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pwlin/cordova-plugin-file-opener2/issues/199#issuecomment-372004781, or mute the thread https://github.com/notifications/unsubscribe-auth/AJhsTyjHrjw_4hWxiMnnrfaj3GgrPYm-ks5tc2XdgaJpZM4SjOYf .

devjoks commented 6 years ago

same problem here ... can you update the plugin.xml ?? use:

<framework src="com.android.support:support-v4:27+" />

instead of:

<framework src="com.android.support:support-v4:+" />
zbarbuto commented 6 years ago

I was able to fix the error by installing this plugin (found from this comment) :

cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=24.+

JoeMeeks commented 6 years ago

If you're using @ionic-native/file-opener run ionic cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=24.+. This will fix Android build errors in Ionic Pro. Thanks @zbarbuto – Great Scott!

shnist commented 5 years ago

we've just released a new version, 2.1.0, that allows you to optionally specify an android support version at installation cordova plugin add cordova-plugin-file-opener2 --variable ANDROID_SUPPORT_VERSION={required version} this should hopefully resolve all the issues around this.