Error when building the android app
See original GitHub issueYour 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
- I created a blank react-native App
- Installed this npm package
- Ran npm run android which runs react-native run-android
- I got the errors above
Context
Debug logs
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:8
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doing this step fixed the issue.
Same issue +1