7

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.

2
  • When using react-native and upgrading packages a lot of times things go broke! Have you tried rm -rf your entire app and reinstalling, then installing, then re linking. This issue sounds like a linking issue, react-native link didn't always work as intended for myself. Ultimately I downgraded to xcode 9 with a manual install then rebuilt through xcode (I don't know xcode well, its easy). This all happened for me when I installed High Sierra and upgraded Xcode. (Hopefully this helps even though you're using android) Commented Dec 26, 2017 at 17:10
  • IOS works fine for us ... We have a problem with android Commented Jan 2, 2018 at 14:34

4 Answers 4

0

I think your android project still have the old linking. You should open your project in android studio and check your main activity class

Sign up to request clarification or add additional context in comments.

3 Comments

I will check it next week and let you know if it works. Thank you!
I tried to unlink this module and link it again and then i tried to link it manually but nothing work
try update android build tools in gradle and rebuild your project
0

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

1 Comment

Downgrading is not an option for me, I signaled the issue on github. My question is related to v2.0.0 beta and RN>=0.50
0

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.