"Getting started..." app crashes on Android 5.0.1

Hello,

I ran into the problem with my Flutter app I need to run on an older Android device w/ Android 5.0.1 (API lvl 21). Then the same problem manifested even with a brand new “Getting started with Flutter” application: the app stops and ​the “Unforutnately, [app name] has stopped.” dialog is shown. It crashes both on physical device and on emulator.

On the emulator with API lvl 22 (Android 5.1) the same app runs without any problems.
​It also runs normally on the physical device with Android 9 on it

I cannot see any obvious problems in the output “flutter run -v”. The app is exiting with the following statement:

[   +3 ms] executing: /Users/lisak/Library/Android/sdk/build-tools/30.0.2/aapt dump xmltree /Users/lisak/Projects/test3/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[   +9 ms] Exit code 0 from: /Users/lisak/Library/Android/sdk/build-tools/30.0.2/aapt dump xmltree /Users/lisak/Projects/test3/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1e
               A: android:compileSdkVersionCodename(0x01010573)="11" (Raw: "11")
               A: package="com.example.test3" (Raw: "com.example.test3")
               A: platformBuildVersionCode=(type 0x10)0x1e
               A: platformBuildVersionName=(type 0x10)0xb
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1e
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=16)
                 A: android:label(0x01010001)="test3" (Raw: "test3")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=21)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.test3.MainActivity" (Raw: "com.example.test3.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=35)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: meta-data (line=45)
                     A: android:name(0x01010003)="io.flutter.embedding.android.SplashScreenDrawable" (Raw: "io.flutter.embedding.android.SplashScreenDrawable")
                     A: android:resource(0x01010025)=@0x7f040000
                   E: intent-filter (line=49)
                     E: action (line=50)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=52)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=59)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2

Here is the output of my “flutter doctor -v”

$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.4 20F71 darwin-x64, locale en-GB)
   ​• Flutter version 2.2.0 at /Users/lisak/Projects/tools/flutter
   ​• Framework revision b22742018b (6 weeks ago), 2021-05-14 19:12:57 -0700
   ​• Engine revision a9d88a4d18
   ​• Dart version 2.13.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
   ​• Android SDK at /Users/lisak/Library/Android/sdk
   ​• Platform android-30, build-tools 30.0.2
   ​• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
   ​• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
   ​• All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
   ​✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
     ​Download at: https://developer.apple.com/xcode/download/
     ​Or install Xcode via the App Store.
     ​Once installed, run:
       ​sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
       ​sudo xcodebuild -runFirstLaunch
   ​✗ CocoaPods not installed.
       ​CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
       ​Without CocoaPods, plugins will not work on iOS or macOS.
       ​For more info, see https://flutter.dev/platform-plugins
     ​To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
   ​• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
   ​• Android Studio at /Applications/Android Studio.app/Contents
   ​• Flutter plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/9212-flutter
   ​• Dart plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/6351-dart
   ​• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1)
   ​• IntelliJ at /Applications/IntelliJ IDEA.app
   ​• Flutter plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/9212-flutter
   ​• Dart plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.55.1)
   ​• VS Code at /Applications/Visual Studio Code.app/Contents
   ​• Flutter extension can be installed from:
     ​🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
   ​• Lenovo TAB S8 50F (mobile) • Baytrail620C63BD • android-x86    • Android 5.0.1 (API 21)
   ​• Chrome (web)               • chrome           • web-javascript • Google Chrome 91.0.4472.114

! Doctor found issues in 1 category.
LisakovoMacPro:~/Projects/test3$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.4 20F71 darwin-x64, locale en-GB)
   ​• Flutter version 2.2.0 at /Users/lisak/Projects/tools/flutter
   ​• Framework revision b22742018b (6 weeks ago), 2021-05-14 19:12:57 -0700
   ​• Engine revision a9d88a4d18
   ​• Dart version 2.13.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
   ​• Android SDK at /Users/lisak/Library/Android/sdk
   ​• Platform android-30, build-tools 30.0.2
   ​• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
   ​• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
   ​• All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
   ​✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
     ​Download at: https://developer.apple.com/xcode/download/
     ​Or install Xcode via the App Store.
     ​Once installed, run:
       ​sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
       ​sudo xcodebuild -runFirstLaunch
   ​✗ CocoaPods not installed.
       ​CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
       ​Without CocoaPods, plugins will not work on iOS or macOS.
       ​For more info, see https://flutter.dev/platform-plugins
     ​To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
   ​• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
   ​• Android Studio at /Applications/Android Studio.app/Contents
   ​• Flutter plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/9212-flutter
   ​• Dart plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/6351-dart
   ​• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1)
   ​• IntelliJ at /Applications/IntelliJ IDEA.app
   ​• Flutter plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/9212-flutter
   ​• Dart plugin can be installed from:
     ​🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.55.1)
   ​• VS Code at /Applications/Visual Studio Code.app/Contents
   ​• Flutter extension can be installed from:
     ​🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
   ​• Lenovo TAB S8 50F (mobile)         • Baytrail620C63BD • android-x86    • Android 5.0.1 (API 21)
   ​• Android SDK built for x86 (mobile) • emulator-5554    • android-x86    • Android 5.1.1 (API 22) (emulator)
   ​• Chrome (web)                       • chrome           • web-javascript • Google Chrome 91.0.4472.114

Am I doing something wrong, or is there some problem within Flutter itself?

Many thanks in advance for any help,

Jan