Software Archive
Read-only legacy content

Plugins with Gradle Scripts

Ömer_G_
Beginner
2,301 Views

Hi team,

I wonder when we will be able to use plugins which use Gradle Scripts.

It's really needen, because most of the plugins cannot be used for now.

Regards,

0 Kudos
30 Replies
Rakshith_K_Intel
Employee
1,768 Views

Which plugins are you using?

0 Kudos
Ömer_G_
Beginner
1,768 Views

For example, probably the most-needed 3rd parth plugin, phonegap-push-plugin for CLI5

It's just in featured list, but cannot debug, cannot build.

I just tried Pushwoosh, it's builded in android, but does not installed on device.

0 Kudos
John_H_Intel2
Employee
1,768 Views

Why doesnt it install on device?

Can you provide a screenshot of the issue?

How are you trying to install it? adb, usb, email link?

0 Kudos
Ömer_G_
Beginner
1,768 Views

I try BUILD tab on XDK, generate APK, put the APK to my server, download it and try to install.

My android device (samsung note4) gives error: "Not Installed", that's all.

On the other hand, phonegap push blugin can not be buit either because of these cradle scripts issue

0 Kudos
Rakshith_K_Intel
Employee
1,768 Views

@omer can try using the intel-xdk branch of Pushwoosh plugin, this should work. 

The issue you are seeing "not installed" is because of a bug that Pushwoosh mentioned on their website:

VERY IMPORTANT: Due to a bug in Cordova-generated projects for Android, you will be unable to install more than one application with Pushwoosh plugin on the same device

http://docs.pushwoosh.com/docs/cordova-phonegap

You will be able to install your app if you delete all other apps on the device that uses pushwoosh, or rebuild using intel-xdk branch pushwoosh plugin: https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/tree/intel-xdk

0 Kudos
Gary_H_2
New Contributor I
1,768 Views

I think this is the same issue as discussed here https://software.intel.com/en-us/forums/intel-xdk/topic/604103 that I have been seeing when I build with the PushWoosh plugin from the featured plugins section. 

As per the suggestion here I've tried building with the intel-xdk version but the build fails. Any ideas why?

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
	at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
	at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
	at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
	at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
	at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
	at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
	at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
	at com.android.dx.command.dexer.Main.run(Main.java:246)
	at com.android.dx.command.dexer.Main.main(Main.java:215)
	at com.android.dx.command.Main.main(Main.java:106)

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dexArmv7Release'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
  	/Developer/tools/adt-bundle/android-sdk/build-tools/21.1.2/dx --dex --output .../Wispeo/platforms/android/build/intermediates/dex/armv7/release --input-list=.../Wispeo/platforms/android/build/intermediates/tmp/dex/armv7/release/inputList.txt
  Error Code:
  	2
  Output:
  	
  	UNEXPECTED TOP-LEVEL EXCEPTION:
  	com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
  		at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
  		at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
  		at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
  		at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
  		at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
  		at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
  		at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
  		at com.android.dx.command.dexer.Main.run(Main.java:246)
  		at com.android.dx.command.dexer.Main.main(Main.java:215)
  		at com.android.dx.command.Main.main(Main.java:106)
  	


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 20.242 secs

.../Wispeo/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: .../Wispeo/platforms/android/gradlew with args: cdvBuildRelease,-b,.../Wispeo/platforms/android/build.gradle,--no-daemon
Command finished with error code 8: .../Wispeo/platforms/android/cordova/build --release
ERROR building one of the platforms: Error: .../Wispeo/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: .../Wispeo/platforms/android/cordova/build: Command failed with exit code 8
    at ChildProcess.whenDone (/Developer/cordova/cordova-cli/5.1.1/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
0 Kudos
Gary_H_2
New Contributor I
1,768 Views

Has anyone else used the intel-xdk version of PushWoosh and built with Cordova CLI 5.1.1 & Crosswalk successfully?

0 Kudos
John_H_Intel2
Employee
1,768 Views

I have a generic app that includes pushwoosh, and it builds crosswalk 5.1.1 without an issue. What version of the pushwoosh plugin are you using? Do you have other conflicting plugins?

Build Log:
  • Building a Cordova 5.1.1 application.
  • The application name is "pushWoosh-1-19-16"
  • The package name is "xdk.intel.blank.template.crosswalk"
  • Plugin "cordova-plugin-statusbar" (1.0.0) installed.
  • Plugin "cordova-plugin-device" (1.0.1) installed.
  • Plugin "cordova-plugin-splashscreen" (2.1.0) installed.
  • Plugin "com.pushwoosh.plugins.pushwoosh" (3.6.16) installed.
  • Plugin "cordova-plugin-legacy-whitelist" (1.1.0) installed.
  • Plugin "cordova-plugin-crosswalk-webview" (1.3.1) installed.
  • App name updated to [pushWoosh-1-19-16]
  • Updated "minSdkVersion" with "14"
  • Updated "targetSdkVersion" with "19"
  • Updated "installLocation" to "auto"
  • Updated "versionCode" to "1"
  • Updated "versionName" to "0.0.1"
  • Added "debuggable" to "false"
0 Kudos
Ömer_G_
Beginner
1,768 Views

Hi John,

Thanks for reply.

As I stated in my previous post, "I just tried Pushwoosh, it's builded in android, but does not installed on device.".

There's no any other apps that pushwood is used in my device, its completely new device.

..and as i stated before, when the build system of intel is going to support Graddle scripts..

Because after now, we need to build our apps for CLI 5.1.1 minimum and all the plugins are started to use Gradle Scripts. We want to use these plugins, that's why we use cordova: fast-development.

Your team says that CLI 4x will not be supported after March, and at the same time, build system does not support these new gradle scripts. If it's not going to be supported in near time, we will have to change our development environment, because the build-system is almost the only thing why we choose to develop in XDK.

Best regards,

0 Kudos
Gary_H_2
New Contributor I
1,768 Views

Hi Omer, don't want to side track your thread but my problems with PushWoosh seem relevant to yours so that's why I have commented here rather than start a new thread.

John, what branch of the PushWoosh plugin are you using? For me I can build successfully with the version in the "Featured" plugins but that has the issue Rakshith mentions above that it can install ok provided there are no other apps installed that use the Play Services library. His suggestion is to use the intel-xdk branch but that doesn't build with CLI 5.1.1 presumably because of the Gradle issues Omer is refering to.

This is a serious issue for us because we are committed to using PushWoosh and now have discovered the version of our App in the Play Store that uses the "Featured" plugin can't be installed on some devices.

 

0 Kudos
Rakshith_K_Intel
Employee
1,768 Views

@Omar  Can u attach the intel-xdk screenshot of build fail message that shows the list of plugins installed?

0 Kudos
Pedro_O_
Beginner
1,768 Views

We are having the same problem.

The application compiles correctly, but in time to install the Play Store it occurs the error of double authority.

Below is a list of installed plugins:

  • Plugin: cordova-plugin-statusbar - Version: 1.0.0
  • Plugin: cordova-plugin-device - Version: 1.0.1
  • Plugin: cordova-plugin-splashscreen - Version: 2.1.0
  • Plugin: cordova-plugin-network-information - Version: 1.0.1
  • Plugin: intel.xdk.device - Version: 1.2.5
  • Plugin: cordova-plugin-x-socialsharing - Version: 5.0.7
  • Plugin: cordova-plugin-camera - Version: 1.2.0
  • Plugin: cordova-plugin-file - Version: 2.1.0
  • Plugin: cordova-plugin-file-transfer - Version: 1.4.0
  • Plugin: com.pushwoosh.plugins.pushwoosh - Version: 3.6.16
  • Plugin: cordova-plugin-legacy-whitelist - Version: 1.1.0

I saw the solution posed by Gary H. for Cordova, we have something like the XDK?

Help us, the application is in production and can not deliver to my clients.

Thank you!

0 Kudos
Rakshith_K_Intel
Employee
1,768 Views

@Pedro.O

Please try the Pushwoosh plugin from pushwoosh github intel-xdk branch, download as zip and add it as third-party -> local import.

https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/tree/intel-xdk

This fixes the issue of not being able to install if there is another app with pushwoosh installed.

 

0 Kudos
Gary_H_2
New Contributor I
1,768 Views

When I do this the build fails as per msg #7 in this thread. Here are the plugins I'm using:-

 

0 Kudos
Rakshith_K_Intel
Employee
1,768 Views

@Gary H.

Can you try this? 

get the intel-xdk branch of pushwoosh, make this change in the plugin.xml:

replace this line:

<source-file src="src/android/lib/android-support-v4.jar" target-dir="libs" />

with:

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

add as local plugin in intelXDK and build

 

0 Kudos
Gary_H_2
New Contributor I
1,768 Views

Hi, Rakshith thanks for the response.

I tried that and it builds (hooray) provided I remove the Google Maps plugin (boo). Any ideas why that might be and how I can have both PushWoosh and Google Maps? I remember seeing somewhere that PushWoosh and AdMob don't play well together because of a clash with both trying to use Google Play Services. Do you think that might be happening here?

 

 

0 Kudos
Rakshith_K_Intel
Employee
1,768 Views

@Gary H.

which one is the google maps plugin?, I dont see it in the screenshot you have attached, send me a link to it.

To explain the build failure you were seeing before, the pushwoosh intel-xdk plugin has framework dependencies added as .jar files, you have another plugin "de.appplant.cordova.plugin.local-notification" that also has same dependency ("com.android.support:support-v4:+), so there was build error saying "multiple definition...", the workaround I gave above removes this .jar file and replaces with <framework> tag, this resolves conflict in build and succeeds.

The pushwoosh also has another dependency added as .jar file (com.google.android.gms:play-services-gcm:+), but this .jar cannot be replaced, since it has the gradle workaround that pushwoosh requires, so if u have any other plugin that has the play-services dependency, build will fail, we dont have a workaround for that currently, my guess is that the google maps plugin has that dependency.

Is this the google map plugin, u are using? https://github.com/mapsplugin/cordova-plugin-googlemaps, ;this has play-services dependency, so build will fail currently, I will let u know if I figure out a workaround. One solution is to build android app using cordova-cli on your system with the master branch pushwoosh+gradle workaround.

 

 

 

 

0 Kudos
Gary_H_2
New Contributor I
1,768 Views

Rakshith thanks, you are correct. When I sent you the screenshot i wasn't using  https://github.com/mapsplugin/cordova-plugin-googlemaps and so it was de.appplant.cordova.plugin.local-notification that was causing the problem. The next version of our app was supposed to use Google Maps hence why i was trying to build with  https://github.com/mapsplugin/cordova-plugin-googlemaps which caused the second conflict. I've seen reports of other issues with Google Maps and Crosswalk so we may just use MapBox instead to avoid the hassles.

Your workaround is great for our immediate needs as we can update our released version in the Play Store and avoid the "duplicate authority" issue that was preventing some people from installing. Thanks again for your help.

 

0 Kudos
Michael_O_2
New Contributor I
1,768 Views

I have tried numerous push plugins, but my app build keeps failing.

When will you guys add Gradle script to your build system?

#Frustrating.

0 Kudos
PaulF_IntelCorp
Employee
1,603 Views

Michael -- we want to add gradle support for plugins, but we cannot at this time due to the security risks they present. Gradle scripts present a security risk to your apps and your account because it allows an unscrupulous user to create a plugin that can do anything with the build server.  :(  We are working on a build system that would insure the necessary level of security, but until then, we cannot support the use of plugin-based gradle scripts.
 

0 Kudos
Reply