react-native-admob
react-native-admob copied to clipboard
error: package android.support.annotation does not exist
Hi, I've seen this or similar errors in previous reported issues however they are all closed as the problem was resolved. I've tried all the solutions in the previous issues with no success.
This issue appears as soon as I add the react-native-admob package and run my app. I am using Android Studio 3.6.3, react-native 0.62.2 and react-native-admob 2.0.0-beta.6 (I get the same issue with react-native-admob 1.3.2 as well).
To replicate, I do the following:
> npx react-native init testrnadmob
> cd testrnadmob
> npm install --save [email protected]
open the project in Android Studio
> npm start
run the project in Android Studio on emulator
errors in the Build Output
D:\Projects\testrnadmob\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobBannerViewManager.java:4: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
D:\Projects\testrnadmob\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobInterstitialAdModule.java:5: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
D:\Projects\testrnadmob\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobRewardedVideoAdModule.java:5: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
D:\Projects\testrnadmob\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNPublisherBannerViewManager.java:4: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
Has anybody else had this issue and found a solution?
Having this issue too, can't fix, same stack
edit: possible fix https://github.com/sbugert/react-native-admob/issues/448#issuecomment-537659889
npm install --save-dev jetifier npx jetify npx react-native run-android
npm install --save-dev jetifier npx jetify npx react-native run-android
Thank you. This solved my issue.
@tlgync Good solution
npm install --save-dev jetifier npx jetify npx react-native run-android
had the same issue after upgrading to 0.64 with react-native-tcp and react-native-udp did they removed jetifier from react native cli?