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

cannot find symbol android.support.v4.app.ActivityCompat #22

Open
Duskyman opened this issue Mar 4, 2021 · 3 comments
Open

cannot find symbol android.support.v4.app.ActivityCompat #22

Duskyman opened this issue Mar 4, 2021 · 3 comments

Comments

@Duskyman
Copy link

Duskyman commented Mar 4, 2021

Hi!

First of all I want to thank you for creating this package! Today I went to work on my project using this package and suddenly the build on android started failing with this error:

> Task :react-native-shared-group-preferences:compileReleaseJavaWithJavac FAILED
/path/to/my/project/node_modules/react-native-shared-group-preferences/android/src/main/java/com/poppop/RNReactNativeSharedGroupPreferences/RNReactNativeSharedGroupPreferencesModule.java:12: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
1 error

I found out, that after replacing
import android.support.v4.app.ActivityCompat;
with
import androidx.core.app.ActivityCompat;
I am able to run the builds again. Can you have a look at this issue please?

Thanks!

@KjellConnelly
Copy link
Owner

@Duskyman not sure exactly as I write a lot more ObjC and JS than android/Java. This thread seems to have some suggestions:

jsierles/react-native-audio#335

@Duskyman
Copy link
Author

Duskyman commented Mar 4, 2021

@KjellConnelly Yeah, I got the solution exactly from there :D

jsierles/react-native-audio#335 (comment)

global search and replace "android.support.v4.content.ContextCompat" by "androidx.core.app.ActivityCompat"

I too don't write any android/Java,

@KjellConnelly
Copy link
Owner

KjellConnelly commented Mar 4, 2021

I'm guessing either it's because using/not using androidX and having certain tools installed, or something with gradle build tools.

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

2 participants