transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
655 stars 277 forks source link

Build fails with the error - Could not find :tslocationmanager:. #580

Closed id4coding closed 6 years ago

id4coding commented 6 years ago

Your Environment

Expected Behavior

Build should succeed / run to completion.

Actual Behavior

Build fails.

Steps to Reproduce

  1. ionic cordova run android --debug

Context

Trying to build an apk.

Debug logs

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find :tslocationmanager:.
  Searched in the following locations:
      file:/home/vivek/Android/Sdk/extras/m2repository//tslocationmanager//tslocationmanager-.pom
      file:/home/vivek/Android/Sdk/extras/m2repository//tslocationmanager//tslocationmanager-.aar
      file:/home/vivek/Android/Sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.pom
      file:/home/vivek/Android/Sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.aar
      file:/home/vivek/Android/Sdk/extras/android/m2repository//tslocationmanager//tslocationmanager-.pom
      file:/home/vivek/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/vivek/projects/challo-ng/platforms/android/app/src/android/libs/tslocationmanager-.aar
      file:/home/vivek/projects/challo-ng/platforms/android/app/src/android/libs/tslocationmanager.aar
  Required by:
      project :app

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

* Get more help at https://help.gradle.org

BUILD FAILED
 in 27s
14 actionable tasks: 1 executed, 13 up-to-date
(node:12713) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /home/vivek/projects/challo-ng/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 :tslocationmanager:.
  Searched in the following locations:
      file:/home/vivek/Android/Sdk/extras/m2repository//tslocationmanager//tslocationmanager-.pom
      file:/home/vivek/Android/Sdk/extras/m2repository//tslocationmanager//tslocationmanager-.aar
      file:/home/vivek/Android/Sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.pom
      file:/home/vivek/Android/Sdk/extras/google/m2repository//tslocationmanager//tslocationmanager-.aar
      file:/home/vivek/Android/Sdk/extras/android/m2repository//tslocationmanager//tslocationmanager-.pom
      file:/home/vivek/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/vivek/projects/challo-ng/platforms/android/app/src/android/libs/tslocationmanager-.aar
      file:/home/vivek/projects/challo-ng/platforms/android/app/src/android/libs/tslocationmanager.aar
  Required by:
      project :app

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

* Get more help at https://help.gradle.org

BUILD FAILED in 27s
(node:12713) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
id4coding commented 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.

christocracy commented 6 years ago

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.

christocracy commented 6 years ago

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

id4coding commented 6 years ago

I downgraded to platform android@~6.3.0 and build ran to completion. Thanks for pointing that out.

christocracy commented 6 years ago

I was experimenting with cordova-android@7.0.0 before xmas. I know exactly what needs to be done. It will be supported soon.

gmkohler commented 6 years ago

@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.

christocracy commented 6 years ago

Keep your eye on the CHANGELOG.

I don’t see it for at least 2 weeks

christocracy commented 6 years ago

You’re free to fork the plugin yourself and make the necessary changes.

gmkohler commented 6 years ago

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?

christocracy commented 6 years ago

cordova-android 7.0

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:

christocracy commented 6 years ago

Anything referencing AndroidManifest in plugin.xml needs to change.

The target to tslocationmanager.aar probably needs to change as well.

mvr-devs commented 6 years ago

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 ?

mvr-devs commented 6 years ago

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...

christocracy commented 6 years ago

Shouldn't need multiDexEnabled. Search here for targetSdkVersion

mvr-devs commented 6 years ago

I have this in config.xml

<preference name="android-targetSdkVersion" value="26" />

nedpuganti commented 6 years ago
* 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
christocracy commented 6 years ago

You're using Cordova 8. The plugin isn't ready. Use 7.x

christocracy commented 6 years ago

As noted right up there

keerthivasan12 commented 6 years ago

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

keerthivasan12 commented 6 years ago

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

christocracy commented 6 years ago

@keerthivasan12 You cannot use cordova-android >= 6.x currently.

bollatialfredo commented 6 years ago

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.

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
christocracy commented 6 years ago

The answer is right up there: https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/580#comment-369912929

bollatialfredo commented 6 years ago

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)

christocracy commented 6 years ago

If you're using Cordova 8:

$ cordova platform add android@6.4.0
bollatialfredo commented 6 years ago

@christocracy any estimate to offer support for Android 7.0.0?

christocracy commented 6 years ago

When other major plugins, such as PhoneGap-plugin-push start supporting it.

steveetm commented 6 years ago

Phonegap-plugin-push supports it since 2.2