Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin is not working with Phonegap Build for android #3

Closed
ayyazzafar opened this issue Feb 12, 2016 · 2 comments
Closed

Plugin is not working with Phonegap Build for android #3

ayyazzafar opened this issue Feb 12, 2016 · 2 comments

Comments

@ayyazzafar
Copy link

I tried to build my simple app using this plugin from https://build.phonegap.com
But build was failed for android with following error:
http://prntscr.com/a28aty

Following is Log

`Build Date: 2016-02-12 09:57:20 +0000

PLUGIN OUTPUT

Installing "com.phonegap.plugins.barcodescanner@2.2.0" for android
Installing "org.apache.cordova.file@1.3.3" for android
Installing "org.apache.cordova.globalization@0.3.4" for android
Installing "org.apache.cordova.vibration@0.3.13" for android
Installing "org.apache.cordova.splashscreen@1.0.0" for android
Installing "org.apache.cordova.media@0.2.16" for android
Installing "org.apache.cordova.inappbrowser@0.6.0" for android
Installing "org.apache.cordova.dialogs@0.3.0" for android
Installing "org.apache.cordova.device-motion@0.2.11" for android
Installing "org.apache.cordova.battery-status@0.2.12" for android
Installing "org.apache.cordova.camera@0.3.6" for android
Installing "org.apache.cordova.network-information@0.2.15" for android
Installing "org.apache.cordova.media-capture@0.3.6" for android
Installing "org.apache.cordova.geolocation@0.3.12" for android
Installing "org.apache.cordova.file-transfer@0.5.0" for android
Installing "org.apache.cordova.device@0.3.0" for android
Installing "org.apache.cordova.device-orientation@0.3.11" for android
Installing "org.apache.cordova.contacts@0.2.16" for android
Fetching plugin "cordova-plugin-request-location-accuracy" via npm
Installing "cordova-plugin-request-location-accuracy@1.0.1" for android
Fetching plugin "cordova-plugin-flashlight" via npm

Installing "cordova-plugin-flashlight@3.0.0" for android

COMPILE OUTPUT

/project/cordova/node_modules/q/q.js:126
throw e;
^

Error: Project contains at least one plugin that requires a system library. This is not supported with ANT. Please build using gradle.
at /project/cordova/lib/build.js:183:27
at _fulfilled (/project/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/project/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/project/cordova/node_modules/q/q.js:760:13)
at /project/cordova/node_modules/q/q.js:574:44
at flush (/project/cordova/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:417:9)
at process._tickCallback (node.js:346:13)`

@dpa99c
Copy link
Owner

dpa99c commented Feb 12, 2016

The plugin depends on the Google Play Services Location library and in order to satisfy this dependency it requires that Gradle be used as the build tool, not ANT (which is deprecated).

I understand that Phonegap Build is now using Gradle by default but from the error message, it looks like your project is being built with ANT.

Try adding the following preference to your config.xml (taken from PGB docs):

<preference name="android-build-tool" value="gradle" />

@ayyazzafar
Copy link
Author

Oh. That worked like charm. Thanks a lot.

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

No branches or pull requests

2 participants