Giter Club home page Giter Club logo

Comments (16)

marcusbesjes avatar marcusbesjes commented on September 12, 2024 1

I'm adding those plugins in the following way:

cordova plugin add [email protected] --variable XWALK_VERSION="14"
cordova plugin add https://github.com/exozet/cordova-chromecast.git

then I'm able to build

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hi @marcusbesjes

Maybe some of the plugins is already using that part of Google Play Services which is needed for our SDK. Please check our Google Play Services guide from README: https://github.com/adjust/cordova_sdk/#4-google-play-services

Feel free to follow this part about removing Google Play Services dependency from our plugin and retry.

Let me know if that worked for you.

Cheers

from cordova_sdk.

marcusbesjes avatar marcusbesjes commented on September 12, 2024

man that really looks like it should fix this, but unfortunately I'm still getting the same error.

I tried to edit the plugins/com.adjust.sdk/plugin.xml in the project and rebuild, and I tried removing the plugin, editing the adjust_4.3.0/plugin.xml file before adding it to the project, and then running cordova plugin add adjust_4.3.0.

But after both cases I still get the same error :(

tnx for the quick reply btw :)

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hm, I tried to recreate your plugin list, I think error relates to one of these two plugins:

acidhax.cordova.chromecast 0.0.1-alpha "Cordova ChromeCast"
cordova-plugin-crosswalk-webview 1.6.1 "Crosswalk WebView Engine"

For example, once adding them (just adding them, not using them at all), I am unable to build my app. I am getting following error:

:compileArmv7DebugJavaWithJavac/Users/uerceg/Projects/Cordova/AdjustExample/platforms/android/src/acidhax/cordova/chromecast/Chromecast.java:12: error: package com.google.android.gms.cast does not exist

followed by bunch of errors saying that different symbols can't be found or that some particular package doesn't exist, etc.

Any idea how to solve this maybe so that I might be able maybe to reproduce error you're getting?

from cordova_sdk.

marcusbesjes avatar marcusbesjes commented on September 12, 2024

Adding the Adjust plugin after those two already gives the > Error: more than one library with package name 'com.google.android.gms' error

from cordova_sdk.

marcusbesjes avatar marcusbesjes commented on September 12, 2024

I can build if I remove the acidhax.cordova.chromecast plugin and add the adjust plugin, so that is where the conflict comes from.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Okay, managed to reproduce the error you are facing, indeed with acidhax.cordova.chromecast plugin and indeed removing -analytics dependency from plugin.xml didn't help.

It looks like things in build.gradle start to conflict after adding/removing different plugins. I managed to fix this in my app by doing this:

cordova platform remove android
cordova platform add android

After that, my app was successfully built with acidhax.cordova.chromecast and com.adjust.sdk plugin. Seems dummy, but worth a try.

Let me know if this worked for you.

from cordova_sdk.

marcusbesjes avatar marcusbesjes commented on September 12, 2024

alas, it doesn't seem to have any effect over here, I removed and added the android platform both on my full list of plugins and on the test project with only chromecast and adjust, both still give the same error. I also tried removing the plugins and adding them in different orders.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hm. :) Funky stuff. After retrying, would be interesting if you can check following part after doing:

cordova build android

When building, gradle builds stuff and among other lines, you can see these:

...
:prepareComGoogleAndroidGmsPlayServicesAds750Library
:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library
:prepareComGoogleAndroidGmsPlayServicesBase750Library
:prepareComGoogleAndroidGmsPlayServicesCast750Library
:prepareComGoogleAndroidGmsPlayServicesGcm750Library
...

If you build your app w/o our plugin, they look exactly like this, because it looks like that acidhax.cordova.chromecast forces 750 version. In this moment, app is built successfully.
But once our plugin is added, these lines look like:

...
:prepareComGoogleAndroidGmsPlayServicesAds750Library
:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library
:prepareComGoogleAndroidGmsPlayServicesBase750Library
:prepareComGoogleAndroidGmsPlayServicesBasement840Library
:prepareComGoogleAndroidGmsPlayServicesCast750Library
:prepareComGoogleAndroidGmsPlayServicesGcm750Library
...

Since our plugin aims to put latest -analytics version in the app, looks like it changes parts of this from 750 to 840. And as long as you have this mixup, build fails.

Now, to fix this, try this:

  1. Remove android platform from your app.
  2. Edit our plugin.xml and comment that line which includes -analytics part of Google Play Services and save it.
  3. Add android platform back to your app.
  4. Clean
  5. Build

Let me know if it worked in this way. :)

from cordova_sdk.

tvervest avatar tvervest commented on September 12, 2024

Hey @uerceg,
First of all, thanks for the lightning replies on this issue!

I'll be taking over the issue from Marcus as I'm the engineer working on our automated build script(s).

It seems you're right, I have the same lines in the build log and removing the Google Play Services from the plugin.xml file results in a successful build.

It would be a great feature if we could specify the Google Play Services version to use when installing the plugin. This would also prevent problems should Google break the Google Play Services interface in a future release. We've faced numerous problems with wildcard version numbers in previous Cordova releases, so we're very keen on fixating the version so that we can test before updating to a new version.

For the time being we'll just create a fork in which we'll modify the plugin.xml, but I'd love to hear what your thoughts are on a feature to allow users to fixate the version :)

from cordova_sdk.

tvervest avatar tvervest commented on September 12, 2024

P.S. I've tried adding a preference field to the plugin, but for some reason the variable doesn't get replaced with the specified value.

I've applied these changes;

  • added a preference called GOOGLE_PLAY_SERVICES_VERSION to the plugin.xml file within the android platform
  • replaced + version with $GOOGLE_PLAY_SERVICES_VERSION

Adding the plugin with cordova plugin add <path to fork> --arguments GOOGLE_PLAY_SERVICES_VERSION="7.5.0" and re-adding the android platform now results in a gradle file with the line compile "com.google.android.gms:play-services-analytics:$GOOGLE_PLAY_SERVICES_VERSION". Maybe you have an idea why Cordova doesn't replace the variable?

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Hi @tvervest

And sorry for delayed answer. Making possibility for users to pass the value of Google Play Services version sounds like an interesting idea.

I have tried to do the same thing as you, but no luck either. If I try to declare -analytics dependancy in plugin.xml like this:

<!-- .... -->

<preference name="GPS_VERSION" />

<!-- .... -->

<!-- Android -->
<platform name="android">
    <!-- .... -->
    <framework src="com.google.android.gms:play-services-analytics:$GPS_VERSION" />
</platform>

<!-- .... -->

and if I add our plugin with:

cordova plugin add ~/parth/to/cordova_sdk/ --variable GPS_VERSION=8.4.0

I indeed get 8.4.0 assigned to GPS_VERSION variable in ios.json and android.json. If I try to assign that variable ($GPS_VERSION) to what ever value I want to write in AndroidManifest.xml, it works. But trying to assign its value to build.gradle file as part of this line:

<framework src="com.google.android.gms:play-services-analytics:$GPS_VERSION" />

doesn't seem to work for some reason.

Did you maybe find a way to make it work?

Cheers

from cordova_sdk.

tvervest avatar tvervest commented on September 12, 2024

Hey @uerceg, that was exactly where I got stuck :)

I haven't figured out why it didn't work, but I'm afraid it might be a bug/feature of Cordova. It seems the --variable value injection simply doesn't apply to the entire config.

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

Yep, that was pretty much my conclusion after trying to make this happen today. :) I will ping you in here if I manage to find solution for it.

Other than that, any reason still not to close this issue?

from cordova_sdk.

tvervest avatar tvervest commented on September 12, 2024

Great, if I ever find out what was going on exactly I'll update this as well 👍

No reasons not to close this issue, feel free to do so :)

from cordova_sdk.

uerceg avatar uerceg commented on September 12, 2024

👍

Cheers!

from cordova_sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.