While running flutter App for first time you might be facing this issue and you will be getting the following exception in logs:

\AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library [:flutter_inappwebview] D:\Learning\flutter\code\my_app\build\flutter_inappwebview\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
	Suggestion: use a compatible library with a minSdk of at most 16,
		or increase this project's minSdk version to at least 17,
		or use tools:overrideLibrary="com.pichillilorenzo.flutter_inappwebview" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

It even gives the suggestion:

> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library [:flutter_inappwebview] D:\Learning\flutter\code\my_app\build\flutter_inappwebview\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
  	Suggestion: use a compatible library with a minSdk of at most 16,
  		or increase this project's minSdk version to at least 17,
  		or use tools:overrideLibrary="com.pichillilorenzo.flutter_inappwebview" to force usage (may lead to runtime failures)

Solution:

  1. open build.gradle file from andriod/app/build.gradle file
  2. Search for “defaultConfig”
  3. Replace minSdkVersion from 16 to 17 as shown below
 defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.my_app"
        minSdkVersion 17
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

Hope it helps. Happy Coding 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *