1

Thanks for reading my question.

I hope you have a good day!

So my question is when I run my flutter project with android emulator, the error message below is shown.

The plugin google_mobile_ads requires a higher Android SDK version.
Fix this issue by adding the following to the file /Users/ahnjunhyun/FlutterProjects/dubu_timer/android/app/build.gradle:
android {
  defaultConfig {
    minSdkVersion 19
  }
}
Note that your app won't be available to users running Android SDKs below 19.
Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.

So I changed minSdkVersion to minSdkVersion 19. Then I got an another error like below!

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/ahnjunhyun/FlutterProjects/dubu_timer/android/app/build.gradle' line: 47

* What went wrong:
A problem occurred evaluating project ':app'.
> Cannot get property '19' on null object

Is there someone who had same problem or knows how to fix?

I need your help

2 Answers 2

1

You must to update minSdkVersion 19 to 21 in order to use google_mobile_ads.

    defaultConfig {
      applicationId "io.flutter.plugins.googlemobileadsexample"
      minSdkVersion 21
      targetSdkVersion 31
      versionCode flutterVersionCode.toInteger()
      versionName flutterVersionName
      testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

Reference : https://github.com/googleads/googleads-mobile-flutter/blob/master/packages/google_mobile_ads/example/android/app/build.gradle

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

Comments

0

Maybe you have typed '19' as a String not an integer so please have a look.

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.