Kureev / react-native-blur

React Native Blur component
MIT License
3.76k stars 556 forks source link

Can't build on Android - cannot find symbol Activity #621

Closed elgambet closed 4 months ago

elgambet commented 4 months ago

I'm having trouble building in Android, I'm receiving the following error:

node_modules/@react-native-community/blur/android/src/main/java/com/reactnativecommunity/blurview/BlurViewManagerImpl.java:22: error: cannot find symbol Activity currentActivity = ctx.getCurrentActivity(); ^ symbol: class Activity location: class BlurViewManagerImpl 1 error

This is my package.json:

{
...

"@react-native-community/blur": "^4.4.0",

"react": "18.2.0",

"react-native": "0.72.5",

...
}

For now I've added the following line using patch-package in the BlurViewManagerImpl.java:

import android.app.Activity;
elgambet commented 4 months ago

I've uninstalled the dependency and installed again, and that solved the issue, I'm sorry I didn't try that before.