Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Can no longer build Cordova with this plugin #38

Closed
RittenInc opened this issue Mar 7, 2018 · 11 comments
Closed

Can no longer build Cordova with this plugin #38

RittenInc opened this issue Mar 7, 2018 · 11 comments

Comments

@RittenInc
Copy link

Hi,

I have been using this plugin, and it has been working great! However recent updates seem to have broken the plugin.

Create new project, add this and only this plugin.

cordova plugin add com-darryncampbell-cordova-plugin-intent
cordova platform add android
cordova run android

`:app:processDebugResourcesC:\Users\me.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\1cef07b5640ca04267708cb0ed9b2629\res\values\values.xml:20:5-70: AAPT: error: re
source android:attr/fontVariationSettings not found.

C:\Users\me.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\1cef07b5640ca04267708cb0ed9b2629\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/ttcInd
ex not found.

C:\Projects\POS\cordova\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/fontVariationSettings n
ot found.
C:\Projects\POS\cordova\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/ttcIndex not found.
error: failed linking references.

FAILED
`

Cordova Version: 8.0.0
Android Version: Everything above 6.2.3 (it does work for this version)

It does work for 6.2.3, however i built a lot of applications on android 7.0.0 that are now failing. I would prefer to not have to regress my applications because I require this fantastic plugin.

Any help would be greatly appreciated.

@darryncampbell
Copy link
Owner

Strange, I was working on a Cordova application earlier today and it was working for me (Cordova 8.0.0 with Android platform 7.0.0). Can you please try cleaning and rebuilding? Looks like the resources are throwing some errors. Or maybe uninstalling and reinstalling the plugin?

@darryncampbell
Copy link
Owner

darryncampbell commented Mar 7, 2018

Here is the project I was working on today that is "working for me" https://github.com/darryncampbell/DataWedgeCordova/tree/DW6.5Improvements (note the branch). I wonder if this could be some interaction with another plugin you are using?

@RittenInc
Copy link
Author

I have tried cleaning it, uninstalling it, uninstalling cordova, reinstalling cordova, the plugin, but it still happens. I remove the plugin and it works.

I even tried cloning the project you just posted. It fails, yet if i remvoe your plugin (com-darryncampbell-cordova-plugin-intent) it builds fine. I think maybe it might be a setting somewhere else? SDK version, cordova update.

I have seen 2 other people on stackoverflow with similar issues (they didn't link their plugins). I will investigate if something else where has changed if this works for you.

Thanks!

@kevinlinar
Copy link

kevinlinar commented Mar 8, 2018

@RittenInc @darryncampbell

I have the same problem

(Cordova 8.0.0 with Android platform 7.0.0).

@RittenInc
Copy link
Author

RittenInc commented Mar 8, 2018

@darryncampbell @kevinnba13

Solved this by changing the plugin.xml file in the plugin from:

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

to:

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

Apparently, a new version of the com.android.support:support-v4 library was released, and the plugin is using defines com.android.support:support-v4:+ as dependency 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.

darryncampbell added a commit that referenced this issue Mar 8, 2018
@darryncampbell
Copy link
Owner

Thank you! I do not have version 28 of the support library installed so that probably explains why I did not see this issue. I have fixed it in the latest version (finally bumped to 1.0.0).

@viking2917
Copy link

I wonder if it's possible to use an earlier support-v4 than 27? It breaks compatibility with other heavily used plugins such as the Facebook plugin (esp: v 1.7.4 heavily used, see phonegap/phonegap-plugin-barcodescanner#606 and jeduan/cordova-plugin-facebook4#507) .

E.g. I see:

ionic start intentCompileTest blank --type ionic1
cd intentCompileTest/
ionic cordova build android  (this works)
ionic cordova plugin add cordova-plugin-facebook4@1.7.4 --save --variable APP_ID="<>" --variable APP_NAME="<>"
ionic cordova build android  (this works)
cordova plugin add com-darryncampbell-cordova-plugin-intent
ionic cordova build android  (this fails)

However if I change your plugin xml to:

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

things compile OK.

@darryncampbell
Copy link
Owner

Hi @viking2917 apologies for the delayed reply but I have been away. I'm happy to change the version to 4:24.1.1+ as long as that would work for all. Sorry if this is a silly question, but would 24.1.1+ pull in version 28.0.0 if that was installed on the development machine? Just want to make sure the original issue is also solved.

@viking2917
Copy link

Hi @darryncampbell thanks and no worries. Thanks for making this plugin!

I am not enough of an Android expert to really know for sure, but I suspect the answer is no, 24.1.1+ only gets 24.1.x. There may not be a good way to do what I am asking for, and I realize it's an older version. The only reason I raised an issue is that it does conflict with some heavily used (but also older) plugins like Facebook one I mentioned.

In any case I've forked this repo and set the build number as I need it, so I'm set for the moment, it may be best to just leave as is....

(in case useful to anyone my fork is https://github.com/viking2917/darryncampbell-cordova-plugin-intent - it also includes a change to add the "Share" intent to the manifest. My use case is making my app show up in the "share" menu for text items, for example text selected in the Kindle app, which can be shared to my bookclub app Bookship.

@darryncampbell
Copy link
Owner

OK, so one option would be to change the version to 24.1.1 (without the +) however I would have concerns doing that in case it breaks compatibility with some other plugins (this particular version has used 27 for a long time apart from the accidental change which started this thread).

I propose to:

  • not change this plugin to use version 24.1.1, the version of the support library will remain at 27.1.0
  • Anybody wishing to use this plugin with the facebook plugin can use the fork you provided above
  • If additional plugins are identified that require support library 24 we can revisit the issue.

I will close this issue unless there are further concerns. Thanks.

@davidquon
Copy link

I'm having this problem as well where I need <framework src="com.android.support:support-v4:24.1.1+" /> due to being tied to older versions of Cordova and Android platform. Using Cordova only for this problematic project without Ionic.

Node version: v7.1.0
Cordova version: 6.5.0
    <engine name="android" spec="~6.1.2" />
    <plugin name="com-darryncampbell-cordova-plugin-intent" spec="https://github.com/iParqDevelopers/darryncampbell-cordova-plugin-intent.git#ritd" />

Also ended up fixing this by forking https://github.com/iParqDevelopers/darryncampbell-cordova-plugin-intent/tree/ritd and just changing the reference in plugin.xml to com.android.support:support-v4:24.1.1+.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants