I have a react-native app which has below dependencies.
"react-native-maps": "^1.15.1",
"react": "17.0.2",
"react-native": "^0.68.0",
when I try to run this app using react-native run-android
, I get below error saying package com.airbnb.android.react.maps does not exist but I installed this package using npm/yarn.
> Task :app:compileDebugJavaWithJavac
WARNING: Using '--release' option could cause issues when using Android Gradle Plugin to compile sources with Java 9+. Instead, please set 'sourceCompatibility' and 'targetCompatibility' to the desired Java version, and set 'compileSdkVersion' to 30 or above. See https://developer.android.com/studio/releases/gradle-plugin#java-11
D:RNRNAppWithAuthLyfterandroidappsrcmainjavacomlyfterMainApplication.java:17: error: package com.airbnb.android.react.maps does not exist
import com.airbnb.android.react.maps.MapsPackage;
^
D:RNRNAppWithAuthLyfterandroidappsrcmainjavacomlyfterMainApplication.java:25: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
D:RNRNAppWithAuthLyfterandroidappsrcmainjavacomlyfterMainApplication.java:65: error: cannot find symbol
if (BuildConfig.DEBUG) {
^
symbol: variable BuildConfig
location: class MainApplication
Note: D:RNRNAppWithAuthLyfterandroidappsrcdebugjavacomlyfterReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
> Task :app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.```
I’m not sure why I’m getting this error and I’m not able to resolve this.
I’m using below version of gradle and andorid gradle plugin
distributionUrl=https://services.gradle.org/distributions/gradle-8.4-all.zip
classpath("com.android.tools.build:gradle:8.3.1")
Can anyone please help me with this? I have tried all that I could find but nothing worked. Been stuck on this for days.
I tried some ways to fix this like by adding implementation line in dependencies but nothing worked
implementation project(':react-native-maps')