Reputation: 10252
Deps:
"native-base": "2.3.5",
"react": "16.0.0",
"react-native": "0.50.4",
"react-native-admob": "^2.0.0-beta.3",
After an update from RN 0.45 to 0.50 and RN-Admob from 1.3.2 to 2.0.0-beta.3
When trying to build with react-native run-android
/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobInterstitialAdModule.java:117:
error: cannot find symbol ArrayList list = nativeArray.toArrayList();
^ symbol: method toArrayList() location: variable nativeArray of type
ReadableNativeArray /Users/dobre/Desktop/projects//node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewardedVideoAdModule.java:129:
error: cannot find symbol ArrayList list = nativeArray.toArrayList();
^ symbol: method toArrayList() location: variable nativeArray of type
ReadableNativeArray /Users/dobre/Desktop/projects//node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNPublisherBannerViewManager.java:252:
error: cannot find symbol ArrayList list = nativeArray.toArrayList();
^ symbol: method toArrayList() location: variable nativeArray of type
ReadableNativeArray /Users/dobre/Desktop/projects//node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNPublisherBannerViewManager.java:271:
error: cannot find symbol ArrayList list = nativeArray.toArrayList();
^ symbol: method toArrayList() location: variable nativeArray of type
ReadableNativeArray /Users/dobre/Desktop/projects//node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobBannerViewManager.java:223:
error: cannot find symbol ArrayList list = nativeArray.toArrayList();
^ symbol: method toArrayList() location: variable nativeArray of type
ReadableNativeArray 5 errors :react-native-admob:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-admob:compileReleaseJavaWithJavac'. Compilation failed; see the compiler error output for details.
I tried also RN 0.51 and manual unlink and re-link but nothing worked.
Upvotes: 7
Views: 2174
Reputation: 1391
Update the file :- Build.gradle(react-native-admob)
//implementation 'com.google.android.gms:play-services-ads:+' // Comment this line
implementation 'com.google.android.gms:play-services-ads:19.7.0' // Add this line
Upvotes: 0
Reputation: 10252
After days of investigations and unlinking and re-linking I solved it with:
maven {
url "$rootDir/../node_modules/react-native/android"
}
in build.gradle
file.
Old url was "$projectDir/../../node_modules/react-native/android"
So it was a gradle issue. When building it used to get old react-native android libs.
Upvotes: 0
Reputation: 3673
Try to check your MainActivity
first, and even if error occurs. Then i think you have to downgrade your react-native-admob
version form v2.0.0 to v1.3.2. It will work definitely.
Because, there is some issue in v2.0.0 which is still beta
. You can check more about this issue on github
here, https://github.com/sbugert/react-native-admob/issues/231
Upvotes: 0
Reputation: 10906
I think your android project still have the old linking. You should open your project in android studio and check your main activity class
Upvotes: 0