1

I am trying to install flutter_smart_cropper package on flutter (adding flutter_smart_cropper: ^0.1.2 in pubspec.yaml, run flutter pub get, run flutter run), and met the following error:

/Users/[USERNAME]/Flutter-QuickStart/my_flutter_smart_cropper/android/app/src/debug/AndroidManifest.xml Error:
        uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:flutter_smart_cropper] /Users/[USERNAME]/Flutter-QuickStart/my_flutter_smart_cropper/build/flutter_smart_cropper/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 19,
                or use tools:overrideLibrary="com.xbo1.flutter_smart_cropper" to force usage (may lead to runtime failures)
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:processDebugManifest'.                  
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:flutter_smart_cropper] /Users/[USERNAME]/Flutter-QuickStart/my_flutter_smart_cropper/build/flutter_smart_cropper/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 19,
                or use tools:overrideLibrary="com.xbo1.flutter_smart_cropper" to force usage (may lead to runtime failures)

Can someone explain what does it mean to increase this project's minSDK version to at least 19, and how do I do so?

neic
  • 145
  • 1
  • 10

2 Answers2

4

The package requires higher minSDK version. You need to upgrade it in ./android/app/build.gradle

You can follow this question

MartinM
  • 401
  • 4
  • 9
-1

//go to android/app/build.gradle defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.edit_profile" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion flutter.minSdkVersion //Now you just have to remove this flutter.minSdkVersion // and write 19 //minSdkVersion 19 // so sync the code it will run targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName }

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 30 '22 at 07:18