Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: package android.support.annotation does not exist #212

Open
Noitham opened this issue Mar 3, 2023 · 2 comments
Open

Error: package android.support.annotation does not exist #212

Noitham opened this issue Mar 3, 2023 · 2 comments

Comments

@Noitham
Copy link

Noitham commented Mar 3, 2023

In case someone comes across this issue, here's a patch to update the imports from android.support.annotation.* to androidx.annotation.*:

patches/react-native-location+2.5.0.patch

diff --git a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java
index 6dbdd3b..1a4de95 100644
--- a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java
+++ b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java
@@ -6,8 +6,9 @@ import android.content.Intent;
 import android.content.IntentSender;
 import android.content.pm.PackageManager;
 import android.location.Location;
-import android.support.annotation.NonNull;
-import android.support.v4.app.ActivityCompat;
+
+import androidx.annotation.NonNull;
+import androidx.core.app.ActivityCompat;
 
 import com.facebook.react.bridge.Arguments;
 import com.facebook.react.bridge.Promise;
diff --git a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java
index 6059fdc..b66dd63 100644
--- a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java
+++ b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java
@@ -2,7 +2,7 @@ package com.github.reactnativecommunity.location;
 
 import android.location.Location;
 import android.os.Build;
-import android.support.annotation.Nullable;
+import androidx.annotation.Nullable;
 
 import com.facebook.react.bridge.Arguments;
 import com.facebook.react.bridge.ReactApplicationContext;

@mkamals1989
Copy link

Try running the command npx jetify. This should fix it.

@usmanabid94
Copy link

Try running the command npx jetify. This should fix it.

This fixed my same issue when i updated my project to 0.72.6.Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants