4

How I can Resolve this warning:

This method should only be accessed from tests or within private scope

It appear after I upgrade the android studio to the latest version!!!

enter image description here

@Composable
fun AppBody() {
    val navController = rememberNavController()
    val context = LocalContext.current
    val width = LocalConfiguration.current.screenWidthDp
    Scaffold(
        bottomBar = {
            AndroidView(
                factory = {
                    AdView(it).apply {
                        setAdSize(
                            AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(
                                context,
                                width
                            )
                        )
                        adUnitId = "*****"
                        loadAd(AdRequest.Builder().build())
                    }
                },
            )
        },
        content = {
            Box(Modifier.padding(it)) {
                AppNavHostController(navController = navController)
            }
        }
    )
}
Marwan Talal
  • 107
  • 6
  • Does this answer your question? [Android - Firebase - TaskSnapshot - Method should only be accessed within private scope?](https://stackoverflow.com/questions/41105586/android-firebase-tasksnapshot-method-should-only-be-accessed-within-privat) – aSemy Jan 16 '23 at 10:26
  • No,,,,,, @aSemy – Marwan Talal Jan 16 '23 at 10:48
  • I'm seeing the same behaviour on my app as well. Did you figure out what's the real issue? – Abdul Mateen Feb 15 '23 at 10:26

1 Answers1

0

It just means whatever you're trying to change (adUnitId I think) has the @VisibleForTesting annotation.

georgiecasey
  • 21,793
  • 11
  • 65
  • 74