danielsogl / awesome-cordova-plugins

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
https://danielsogl.gitbook.io/awesome-cordova-plugins/
Other
2.41k stars 2.43k forks source link

Error Compile cordova-plugin-mauron85-background-geolocation@alpha #2979

Closed AgustinNG closed 5 years ago

AgustinNG commented 5 years ago

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior: After installing the plug-in to recompile to Android it gives error.

Expected behavior:

Steps to reproduce:

Related code: ionic start localizacion blank ionic cordova plugin add cordova-plugin-mauron85-background-geolocation@alpha npm install @ionic-native/background-geolocation ionic cordova build android

Other information: ....

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below): `> Task :app:compileDebugJavaWithJavac FAILED /Users/agustinnavarro/Documents/Lenguajes/Ionic/Demos/fichador/platforms/android/app/src/main/java/com/marianhello/bgloc/service/LocationServiceIntentBuilder.java:26: error: package junit.framework does not exist import junit.framework.Assert; ^ /Users/agustinnavarro/Documents/Lenguajes/Ionic/Demos/fichador/platforms/android/app/src/main/java/com/marianhello/bgloc/service/LocationServiceIntentBuilder.java:164: error: cannot find symbol Assert.assertNotNull("Context can not be null!", mContext); ^ symbol: variable Assert location: class LocationServiceIntentBuilder 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. 2 errors

FAILURE: Build failed with an exception.

BUILD FAILED in 2s 24 actionable tasks: 3 executed, 21 up-to-date /Users/agustinnavarro/Documents/Lenguajes/Ionic/Demos/fichador/platforms/android/gradlew: Command failed with exit code 1 Error output: /Users/agustinnavarro/Documents/Lenguajes/Ionic/Demos/fichador/platforms/android/app/src/main/java/com/marianhello/bgloc/service/LocationServiceIntentBuilder.java:26: error: package junit.framework does not exist import junit.framework.Assert; ^ /Users/agustinnavarro/Documents/Lenguajes/Ionic/Demos/fichador/platforms/android/app/src/main/java/com/marianhello/bgloc/service/LocationServiceIntentBuilder.java:164: error: cannot find symbol Assert.assertNotNull("Context can not be null!", mContext); ^ symbol: variable Assert location: class LocationServiceIntentBuilder 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. 2 errors

FAILURE: Build failed with an exception.

BUILD FAILED in 2s [ERROR] An error occurred while running subprocess cordova.

    cordova build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.`
n0minal commented 5 years ago

I'm having the same issue, just can't get my company app to build.

danielsogl commented 5 years ago

Replace the installed cordova-plugin by ionic cordova plugin add @mauron85/cordova-plugin-background-geolocation and try it again. If you still face errors, open an issue here: https://github.com/mauron85/cordova-plugin-background-geolocation

Makepool commented 5 years ago

Can't get this to work at all, no one can apparently.

kensodemann commented 5 years ago

@Makepool - you probably want to follow issues on the plugin's repo, like this one: https://github.com/mauron85/cordova-plugin-background-geolocation/issues/558

The problem is with the plugin, not with Ionic Native.

n0minal commented 5 years ago

The author of the plug-in won't give you any support for this specific platform-related issue, you should install the alpha version which is a workaround branch that the author made for it to work with ionic, follow the ionic documentation and use cordova 8.1.2.