ammarahm-ed/react-native-admob-native-ads

error while updating property 'requestnonpersonalizedadsonly' of a view managed by : rngadnativeview

haresh4d opened this issue · 11 comments

I am getting this error with the latest version of react-native-google-mobile-ads used with this library.

same, any solution for this?

facing same issue, any idea?

For me the issue was using: com.applovin.mediation:google-adapter+

Started working after changing it to: implementation 'com.applovin.mediation:google-adapter:22.6.0.1

@ammarahm-ed I have solved this issue by commenting the code written in setRequestNonPersonalizedAdsOnly in the Utils.java file. Please find the screenshot. Also let us know whether it will affect the functionality of the module or not and what are the other solutions.
Screenshot 2024-06-27 at 7 56 02 PM

In version 23.0.0, AdManagerAdRequest.Builder methods inherited from its parent can be chained together to build an AdManagerAdRequest using a single call:

var newRequest = AdManagerAdRequest.Builder()
.addCustomTargeting("age", "25") // AdManagerAdRequest.Builder method.
.setContentUrl("https://www.example.com") // Method inherited from parent.
.build() // Builds an AdManagerAdRequest.

A side effect of this change is AdManagerAdRequest.Builder no longer inherits from AdRequest.Builder.

@ammarahm-ed What should we do now?

Following fixed for me:

Change build.gradle line 56 from :

implementation "com.google.android.gms:play-services-ads:${safeExtGet('googlePlayServicesAdsVersion', '20.+')}"

to

implementation "com.google.android.gms:play-services-ads:${safeExtGet('googlePlayServicesAdsVersion', '23.+')}"

@haresh4d still getting this error. Can you please confirm if this is still working for you?

@haresh4d still getting this error. Can you please confirm if this is still working for you?

Use latest versions of react-native-google-mobile-ads and this library

@haresh4d i am using the latest version of both the libraries, react native google mobile ads work fine, but can't seem to get this
package to work, are there any extra steps that you followed to make it work?

Make sure you have GoogleMobileAdsSdk version above 13

@haresh4d since i am using the latest version (14.2.2) of the react native google mobile ads package, i am on version 23.2.0 of the googleMobileAdsSdk.
so i guess that is not what is causing the error?
are you working on ios or android?