question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Your Environment

  • Plugin version: current
  • Platform: Android
  • OS version: N/A
  • Device manufacturer and model: N/A
  • Cordova version (cordova -v):
  • Cordova platform version (cordova platform ls): 6.3.0
  • Plugin configuration options:
  • Link to your project:

Context

I want to build my app with this plugin via phonegap, it is OK if I register plugin by adding following line into my config.xml: <plugin name="cordova-plugin-mauron85-background-geolocation"/>

However, because I have to use another plugin and I follow the instruction you mentioned to set specific google play version and android support library version by the line below, it failed as the log post below.

<plugin name="cordova-plugin-mauron85-background-geolocation"> <variable name="GOOGLE_PLAY_SERVICES_VERSION" value="11+" /> <variable name="ANDROID_SUPPORT_LIBRARY_VERSION" value="23+" /> <variable name="ALWAYS_USAGE_DESCRIPTION" value="App requires background tracking enabled" /> <variable name="MOTION_USAGE_DESCRIPTION" value="App requires motion detection" /> </plugin>

the plugin I am trying to use with yours is cordova-plugin-camera-preview

Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

Context

Yes, app can’t be built

Debug logs

BUILD FAILED

Total time: 2.77 secs Error: /gradlew: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. /src/com/marianhello/bgloc/sync/SyncAdapter.java:149: error: constructor Builder in class Builder cannot be applied to given types; builder = new NotificationCompat.Builder(getContext(), NotificationHelper.SYNC_CHANNEL_ID); ^ required: Context found: Context,String reason: actual and formal argument lists differ in length /src/com/marianhello/bgloc/sync/SyncAdapter.java:214: error: constructor Builder in class Builder cannot be applied to given types; NotificationCompat.Builder builder = new NotificationCompat.Builder(getContext(), NotificationHelper.SYNC_CHANNEL_ID); ^ required: Context found: Context,String reason: actual and formal argument lists differ in length /src/com/marianhello/bgloc/NotificationHelper.java:51: error: constructor Builder in class Builder cannot be applied to given types; NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext, NotificationHelper.SERVICE_CHANNEL_ID); ^ required: Context found: Context,String reason: actual and formal argument lists differ in length 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. 3 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mauron85commented, Oct 16, 2018

ANDROID_SUPPORT_LIBRARY_VERSION 23 seems not to be compatible (it’s too old). But I think you can workaround this issue by replacing lines in plugin.xml

<source-file src="android/common/src/oreo/java/com/marianhello/bgloc/NotificationHelper.java" target-dir="src/com/marianhello/bgloc" />
<source-file src="android/common/src/oreo/java/com/marianhello/bgloc/sync/SyncAdapter.java" target-dir="src/com/marianhello/bgloc/sync" />

with

<source-file src="android/common/src/preoreo/java/com/marianhello/bgloc/NotificationHelper.java" target-dir="src/com/marianhello/bgloc" />
<source-file src="android/common/src/preoreo/java/com/marianhello/bgloc/sync/SyncAdapter.java" target-dir="src/com/marianhello/bgloc/sync" />
1reaction
coyu1314commented, Dec 12, 2018

ANDROID_SUPPORT_LIBRARY_VERSION 23 seems not to be compatible (it’s too old). But I think you can workaround this issue by replacing lines in plugin.xml

<source-file src="android/common/src/oreo/java/com/marianhello/bgloc/NotificationHelper.java" target-dir="src/com/marianhello/bgloc" />
<source-file src="android/common/src/oreo/java/com/marianhello/bgloc/sync/SyncAdapter.java" target-dir="src/com/marianhello/bgloc/sync" />

with

<source-file src="android/common/src/preoreo/java/com/marianhello/bgloc/NotificationHelper.java" target-dir="src/com/marianhello/bgloc" />
<source-file src="android/common/src/preoreo/java/com/marianhello/bgloc/sync/SyncAdapter.java" target-dir="src/com/marianhello/bgloc/sync" />

I can’t find the those two lines that you were referring to. I am using 2.3.6. Am I missing something? I’m having a similar issue where I got an build time error. Thanks

BUILD FAILED in 3s
/Users/symbp/My Files/code/ionic/cabbus_partner_v2.1/platforms/android/gradlew: Command failed with exit code 1 Error output:
/Users/symbp/My Files/code/ionic/cabbus_partner_v2.1/platforms/android/app/src/main/java/com/marianhello/bgloc/ActivityRecognitionLocationProvider.java:68: error: cannot access zzbfm
        if (lastActivity.getType() == DetectedActivity.STILL) {
                        ^
  class file for com.google.android.gms.internal.zzbfm not found
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.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

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

github_iconTop Results From Across the Web

Understanding build issue resolution in practice: symptoms ...
Build failure resolution is a challenging problem and multiple studies have demonstrated that developers spend non-trivial time in resolving ...
Read more >
About Issues | Build - Autodesk Knowledge Network
The Issues tool provides a set of preconfigured categories and types under those categories to organize the issues on your project. You can...
Read more >
Understanding Build Issue Resolution in ... - Zhenpeng Chen
Build failure resolution is a challenging problem and multiple stud- ies have demonstrated that developers spend non-trivial time in resolving encountered build ...
Read more >
Common Build Problems - Travis CI Docs
If your build is failing due to unexpected segmentation faults in the language interpreter, this may be caused by corrupt or invalid caches...
Read more >
[FIXED] Android build failures `No matching variant of ... - GitHub
Description. Hey all, I'd like to share an update on a series of build failures React Native & Expo users have been experiencing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found