Closed id4coding closed 6 years ago
Wanted to mention that I have one project with the plugin running successfully on the same Ubuntu box. But, when I try to create another ionic project with the background geolocation plugin, build fails.
The plugin isn’t ready for platform cordova-android@7.0.0
. Few plugins are. The latest Android platform introduces breaking changes to plugin plugin.xml files.
You should use cordova 7.1.0
until this plugin is made ready for use with cordova-android@7.0.0
.
For information about breaking changes with cordova-android@7.0.0
see here
I downgraded to platform android@~6.3.0 and build ran to completion. Thanks for pointing that out.
I was experimenting with cordova-android@7.0.0
before xmas. I know exactly what needs to be done. It will be supported soon.
@christocracy Do you have any update on supporting cordova-android@7.0.0
? I am running into this same error and am looking to upgrade to 7.0.0
to support some other plugins on the newer Android versions.
Keep your eye on the CHANGELOG.
I don’t see it for at least 2 weeks
You’re free to fork the plugin yourself and make the necessary changes.
Okay, I'm happy to give changing it on a fork a go. Regarding your previous comment:
I know exactly what needs to be done. It will be supported soon.
, what exactly needs to be done?
However this a major breaking change for people creating standalone Cordova Android projects. This also means that the locations of files have changed and have been brought in line to the structure used by Android Studio. This may affect plugin.xml files and config.xml files that use edit-config, and make it so plugins that use edit-config will not be able to be compatible with both Android 6.x and Android 7.x. To fix this issue, please do the following in your XML files:
Anything referencing AndroidManifest
in plugin.xml needs to change.
The target
to tslocationmanager.aar
probably needs to change as well.
I am getting this issue as well... What is the mechanism to downgrade to android@~6.3.0 ? Is it the Cordova CLI or something to change in the config.xml ?
figured it out however the build started failing with errors about
transformclasseswithdexfordebug failed
So googled for that and changed the build.gradle to include the following in the android section:
defaultConfig { minSdkVersion 21 targetSdkVersion 26 multiDexEnabled true }
Which works but you have to edit the build.gradle after every remove/add platform...
Shouldn't need multiDexEnabled
. Search here for targetSdkVersion
I have this in config.xml
<preference name="android-targetSdkVersion" value="26" />
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find :tsbackgroundfetch:.
Searched in the following locations:
file:/Users/inarenedpuganti/Library/Android/sdk/extras/m2repository//tsbackgroundfetch//tsbackgroundfetch-.pom
file:/Users/inarenedpuganti/Library/Android/sdk/extras/m2repository//tsbackgroundfetch//tsbackgroundfetch-.aar
file:/Users/inarenedpuganti/Library/Android/sdk/extras/google/m2repository//tsbackgroundfetch//tsbackgroundfetch-.pom
file:/Users/inarenedpuganti/Library/Android/sdk/extras/google/m2repository//tsbackgroundfetch//tsbackgroundfetch-.aar
file:/Users/inarenedpuganti/Library/Android/sdk/extras/android/m2repository//tsbackgroundfetch//tsbackgroundfetch-.pom
file:/Users/inarenedpuganti/Library/Android/sdk/extras/android/m2repository//tsbackgroundfetch//tsbackgroundfetch-.aar
https://jcenter.bintray.com//tsbackgroundfetch//tsbackgroundfetch-.pom
https://jcenter.bintray.com//tsbackgroundfetch//tsbackgroundfetch-.aar
https://maven.google.com//tsbackgroundfetch//tsbackgroundfetch-.pom
https://maven.google.com//tsbackgroundfetch//tsbackgroundfetch-.aar
https://repo1.maven.org/maven2//tsbackgroundfetch//tsbackgroundfetch-.pom
https://repo1.maven.org/maven2//tsbackgroundfetch//tsbackgroundfetch-.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/src/android/libs/tsbackgroundfetch-.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/src/android/libs/tsbackgroundfetch.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/libs/tsbackgroundfetch-.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/libs/tsbackgroundfetch.aar
Required by:
project :app
> Could not find :tslocationmanager:.
Searched in the following locations:
file:/Users/inarenedpuganti/Library/Android/sdk/extras/m2repository//tslocationmanager//tslocationmanager-.pom
file:/Users/inarenedpuganti/Library/Android/sdk/extras/m2repository//tslocationmanager//tslocationmanager-.aar
file:/Users/inarenedpuganti/Library/Android/sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.pom
file:/Users/inarenedpuganti/Library/Android/sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.aar
file:/Users/inarenedpuganti/Library/Android/sdk/extras/android/m2repository//tslocationmanager//tslocationmanager-.pom
file:/Users/inarenedpuganti/Library/Android/sdk/extras/android/m2repository//tslocationmanager//tslocationmanager-.aar
https://jcenter.bintray.com//tslocationmanager//tslocationmanager-.pom
https://jcenter.bintray.com//tslocationmanager//tslocationmanager-.aar
https://maven.google.com//tslocationmanager//tslocationmanager-.pom
https://maven.google.com//tslocationmanager//tslocationmanager-.aar
https://repo1.maven.org/maven2//tslocationmanager//tslocationmanager-.pom
https://repo1.maven.org/maven2//tslocationmanager//tslocationmanager-.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/src/android/libs/tslocationmanager-.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/src/android/libs/tslocationmanager.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/libs/tslocationmanager-.aar
file:/Users/inarenedpuganti/Documents/trunow/trunow_mobile_ionic/platforms/android/app/libs/tslocationmanager.aar
Required by:
project :app
You're using Cordova 8. The plugin isn't ready. Use 7.x
i am having same problem BUILD FAILED in 24s 11 actionable tasks: 11 executed Error: /home/developer/Documents/myNewProject/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
What went wrong: Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find :tsbackgroundfetch:. Searched in the following locations: file:/home/developer/Android/Sdk/extras/m2repository//tsbackgroundfetch//tsbackgroundfetch-.pom file:/home/developer/Android/Sdk/extras/m2repository//tsbackgroundfetch//tsbackgroundfetch-.aar file:/home/developer/Android/Sdk/extras/google/m2repository//tsbackgroundfetch//tsbackgroundfetch-.pom file:/home/developer/Android/Sdk/extras/google/m2repository//tsbackgroundfetch//tsbackgroundfetch-.aar file:/home/developer/Android/Sdk/extras/android/m2repository//tsbackgroundfetch//tsbackgroundfetch-.pom file:/home/developer/Android/Sdk/extras/android/m2repository//tsbackgroundfetch//tsbackgroundfetch-.aar https://jcenter.bintray.com//tsbackgroundfetch//tsbackgroundfetch-.pom https://jcenter.bintray.com//tsbackgroundfetch//tsbackgroundfetch-.aar https://maven.google.com//tsbackgroundfetch//tsbackgroundfetch-.pom https://maven.google.com//tsbackgroundfetch//tsbackgroundfetch-.aar https://repo1.maven.org/maven2//tsbackgroundfetch//tsbackgroundfetch-.pom https://repo1.maven.org/maven2//tsbackgroundfetch//tsbackgroundfetch-.aar file:/home/developer/Documents/myNewProject/platforms/android/app/src/android/libs/tsbackgroundfetch-.aar file:/home/developer/Documents/myNewProject/platforms/android/app/src/android/libs/tsbackgroundfetch.aar Required by: project :app Could not find :tslocationmanager:. Searched in the following locations: file:/home/developer/Android/Sdk/extras/m2repository//tslocationmanager//tslocationmanager-.pom file:/home/developer/Android/Sdk/extras/m2repository//tslocationmanager//tslocationmanager-.aar file:/home/developer/Android/Sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.pom file:/home/developer/Android/Sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.aar file:/home/developer/Android/Sdk/extras/android/m2repository//tslocationmanager//tslocationmanager-.pom file:/home/developer/Android/Sdk/extras/android/m2repository//tslocationmanager//tslocationmanager-.aar https://jcenter.bintray.com//tslocationmanager//tslocationmanager-.pom https://jcenter.bintray.com//tslocationmanager//tslocationmanager-.aar https://maven.google.com//tslocationmanager//tslocationmanager-.pom https://maven.google.com//tslocationmanager//tslocationmanager-.aar https://repo1.maven.org/maven2//tslocationmanager//tslocationmanager-.pom https://repo1.maven.org/maven2//tslocationmanager//tslocationmanager-.aar file:/home/developer/Documents/myNewProject/platforms/android/app/src/android/libs/tslocationmanager-.aar file:/home/developer/Documents/myNewProject/platforms/android/app/src/android/libs/tslocationmanager.aar Required by: project :app
global packages:
cordova (Cordova CLI) : 7.1.0 local packages:
@ionic/app-scripts : 3.1.8 Cordova Platforms : android 7.1.0 Ionic Framework : ionic-angular 3.9.2
@keerthivasan12 You cannot use cordova-android >= 6.x
currently.
Start a new project with Ionic, add Android platform, add plugin cordova plugin add cordova-background-geolocation-lt
and run command ionic cordova run android
and fails:
FAILURE: Build failed with an exception.
Could not find :tsbackgroundfetch:.
Ionic info:
cli packages: (/usr/lib/node_modules)
@ionic/cli-utils : 1.15.1
ionic (Ionic CLI) : 3.15.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.0
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.2.1
npm : 5.3.0
OS : Linux 4.13
Environment Variables:
ANDROID_HOME : /home/alfredo/Android/Sdk
Misc:
backend : legacy
The answer is right up there: https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/580#comment-369912929
Which version of cordova-android
will work with the plugin? I got this now:
Unmet project requirements for latest version of cordova-background-geolocation-lt: cordova-android (5.2.2 in project, >=6.3.0 required) Current project does not satisfy the engine requirements specified by any version of cordova-background-geolocation-lt. Fetching latest version of plugin anyway (may be incompatible)
If you're using Cordova 8:
$ cordova platform add android@6.4.0
@christocracy any estimate to offer support for Android 7.0.0?
When other major plugins, such as PhoneGap-plugin-push start supporting it.
Phonegap-plugin-push supports it since 2.2
Your Environment
Plugin version: 2.9.1
Platform: iOS or Android
OS version: Ubuntu 17.10
Device manufacturer / model:
Cordova version (
cordova -v
): 8.0.0Cordova platform version (
cordova platform ls
): Installed platforms: android 7.0.0 Available platforms: browser ~5.0.1 ios ~4.5.4 osx ~4.0.1 windows ~5.0.0 www ^3.12.0Plugin config
Expected Behavior
Build should succeed / run to completion.
Actual Behavior
Build fails.
Steps to Reproduce
Context
Trying to build an apk.
Debug logs