Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "cannot find symbol" error on google play services #593

Open
erkankarabulut opened this issue Oct 20, 2021 · 2 comments
Open

Getting "cannot find symbol" error on google play services #593

erkankarabulut opened this issue Oct 20, 2021 · 2 comments

Comments

@erkankarabulut
Copy link

erkankarabulut commented Oct 20, 2021

Hello, I installed the library as written in the readme file and linked it using react-native link react-native-admob. Also I followed these instructions to install mobile ads SDK. My react-native version is 6.1.0

I have implementation 'com.google.android.gms:play-services-ads:20.4.0' in my app/build.gradle dependencies section.

I initialized MobileAds by adding the following code into onCreate() method in my MainApplication.java:

MobileAds.initialize(this, new OnInitializationCompleteListener() {
                @Override
                public void onInitializationComplete(InitializationStatus initializationStatus) {
                }
            });

But I still get tons of cannot find symbol errors for google play ads libraries. For instance:

.../node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewardedVideoAdModule.java:167: error: cannot find symbol
                            adRequestBuilder.addTestDevice(testDevice);

or

.../node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNPublisherBannerViewManager.java:184: error: method does not override or implement a method from a supertype
    @Override

Where am I doing wrong?

@kyle-belle
Copy link

Hello, I installed the library as written in the readme file and linked it using react-native link react-native-admob. Also I followed these instructions to install mobile ads SDK. My react-native version is 6.1.0

I have implementation 'com.google.android.gms:play-services-ads:20.4.0' in my app/build.gradle dependencies section.

I initialized MobileAds by adding the following code into onCreate() method in my MainApplication.java:

MobileAds.initialize(this, new OnInitializationCompleteListener() {
                @Override
                public void onInitializationComplete(InitializationStatus initializationStatus) {
                }
            });

But I still get tons of cannot find symbol errors for google play ads libraries. For instance:

.../node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewardedVideoAdModule.java:167: error: cannot find symbol
                            adRequestBuilder.addTestDevice(testDevice);

or

.../node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNPublisherBannerViewManager.java:184: error: method does not override or implement a method from a supertype
    @Override

Where am I doing wrong?

ever got this fixed?

@ObedAmpah
Copy link

ObedAmpah commented Mar 31, 2022

On this page it has an import for MobileAds, possibly trying adding that?

https://developers.google.com/admob/android/quick-start#kotlin

import com.google.android.gms.ads.MobileAds // <---HERE

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        MobileAds.initialize(this) {}
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants