Home > Mobile >  com.google.android.gms:play-services-ads | ERROR
com.google.android.gms:play-services-ads | ERROR

Time:06-22

After update it to version 21.0.0, I get an error msg (The Val cannot reassign).

implementation 'com.google.android.gms:play-services-ads:21.0.0'

    AndroidView(
    factory = {
        AdView(it).apply {
            adSize = AdSize.FULL_BANNER
            adUnitId = "ca-app-pub-....62"
            loadAd(AdRequest.Builder().build())
        }

    },
)

CodePudding user response:

The variable adSize is now marked private in 21.0.0.
Use the standard setter method instead - setAdSize(yourAdSize)

  • Related