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.

Error when building the android app

See original GitHub issue

Your Environment

  • Plugin version: ^0.6.3
  • Platform: Android
  • OS version: Android 10+
  • Device manufacturer and model: Emulated Android Studio device Pixel 2
  • Running in Simulator: Yes
  • React Native version: ~0.62.2
  • Plugin configuration options:
  • Link to your project:

Context

After installing this package, when I run react-native run-android it gives me some errors

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Script 'C:\react\geoloc-v3\node_modules\@mauron85\react-native-background-geolocation\android\common\VERSIONS.gradle' line: 27

* What went wrong:
A problem occurred evaluating project ':@mauron85_react-native-background-geolocation-common'.
> Could not get unknown property 'android' for project ':app' of type org.gradle.api.Project.

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

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':@mauron85_react-native-background-geolocation-common'.
> compileSdkVersion is not specified.

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

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

BUILD FAILED in 17s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

Then I’ve seen something about app linking. So I’ve tried to run this:

node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postlink.js

And it gave me this error:

PS C:\react\geoloc-v3> node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postlink.js
internal/validators.js:112
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:112:11)
    at Object.join (path.js:375:7)
    at Object.<anonymous> (C:\react\geoloc-v3\node_modules\@mauron85\react-native-background-geolocation\scripts\postlink.js:28:30)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'ERR_INVALID_ARG_TYPE'
}

Expected Behavior

I should be able to run the android app successfully

Actual Behavior

Possible Fix

Steps to Reproduce

  1. I created a blank react-native App
  2. Installed this npm package
  3. Ran npm run android which runs react-native run-android
  4. I got the errors above

Context

Debug logs

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:16
  • Comments:8

github_iconTop GitHub Comments

10reactions
rakesh0rcommented, Jul 25, 2020

Doing this step fixed the issue.

Screen Shot 2020-07-25 at 1 40 58 PM
2reactions
Mhd-Emadcommented, Aug 14, 2020

Same issue +1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues with Android Studio and Android Gradle Plugin
Known issues with Android Studio and Android Gradle Plugin · Error when rendering Compose Preview · Error when using different passwords for key...
Read more >
java - Getting error while building app in android studio
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
This particular error means that the app is importing ./src/Routes and it is not found. The cause could be that the filename case...
Read more >
Failed Builds - Visual Studio App Center - Microsoft Learn
Try checking if the error for the build is consistent when the failures occur. Isolating and interpreting error messages. Automatic error ...
Read more >
Why does a build fail in Android Studio even if I don't have any ...
There are several causes for gradle build fail in Android studio. Few reasons might be: * Dependencies added * Importing the project from...
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