Skip to content

Failed to Build #198

Open
Open
@AlexMercedCoder

Description

@AlexMercedCoder

I'm reviewing this tutorial: https://blog.logrocket.com/react-native-geolocation-a-complete-tutorial/

Everything goes fine till I need to install react-native-location

  • I can install the library fine
  • The link command is no longer part of the CLI but I get errors that it has not been linked

I figured maybe I need to run npx react-native run-android to get it to link

but then I get the following output

info Starting JS server...
info Installing the app...
<===----------> 25% CONFIGURING [873m> Task :react-native-location:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
33 actionable tasks: 2 executed, 31 up-to-date
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:5: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:9: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:10: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:21: error: cannot find symbol
    public static void emitEvent(ReactApplicationContext context, String eventName, @Nullable Object params) {
                                                                                     ^
  symbol:   class Nullable
  location: class Utils
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:163: error: cannot find symbol
            public void onFailure(@NonNull Exception e) {
                                   ^
  symbol: class NonNull
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:227: error: cannot find symbol
            int finePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION);
                                 ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:228: error: cannot find symbol
            int coarsePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION);
                                   ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors
3 warnings

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-location: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.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 2s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:5: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:9: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:10: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:21: error: cannot find symbol
    public static void emitEvent(ReactApplicationContext context, String eventName, @Nullable Object params) {
                                                                                     ^
  symbol:   class Nullable
  location: class Utils
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:163: error: cannot find symbol
            public void onFailure(@NonNull Exception e) {
                                   ^
  symbol: class NonNull
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:227: error: cannot find symbol
            int finePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION);
                                 ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:228: error: cannot find symbol
            int coarsePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION);
                                   ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors
3 warnings

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-location: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.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 2s

    at makeError (/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/execa/index.js:174:9)
    at /home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/@react-native-community/cli/build/index.js:142:9)
info Run CLI with --verbose flag for more details.

Then when run with verbose flag

info Starting JS server...
info Installing the app...
debug Running command "cd android && ./gradlew app:installDebug -PreactNativeDevServerPort=8081"
<===----------> 25% CONFIGURING [883m> Task :react-native-location:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
33 actionable tasks: 2 executed, 31 up-to-date
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:5: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:9: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:10: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:21: error: cannot find symbol
    public static void emitEvent(ReactApplicationContext context, String eventName, @Nullable Object params) {
                                                                                     ^
  symbol:   class Nullable
  location: class Utils
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:163: error: cannot find symbol
            public void onFailure(@NonNull Exception e) {
                                   ^
  symbol: class NonNull
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:227: error: cannot find symbol
            int finePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION);
                                 ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:228: error: cannot find symbol
            int coarsePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION);
                                   ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors
3 warnings

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-location: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.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 2s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:5: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:9: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:10: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java:21: error: cannot find symbol
    public static void emitEvent(ReactApplicationContext context, String eventName, @Nullable Object params) {
                                                                                     ^
  symbol:   class Nullable
  location: class Utils
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:163: error: cannot find symbol
            public void onFailure(@NonNull Exception e) {
                                   ^
  symbol: class NonNull
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:227: error: cannot find symbol
            int finePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION);
                                 ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java:228: error: cannot find symbol
            int coarsePermission = ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION);
                                   ^
  symbol:   variable ActivityCompat
  location: class RNPlayServicesLocationProvider
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors
3 warnings

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-location: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.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 2s

    at makeError (/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/execa/index.js:174:9)
    at /home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/home/alexmerced/development/developmentwork/logrocket/react-native-review/ReactNativeGeolocation2/node_modules/@react-native-community/cli/build/index.js:142:9)

I did try running npx jetify which I saw in another issue, but that did not help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions