Skip to content

Android app fails to launch on API 21 #73118

@JCKodel

Description

@JCKodel

Steps to Reproduce

  1. Use beta channel (currently 1.25.0-8.1.pre]
  2. Create a new project with flutter create foobar
  3. Using a real Android 21 device (mine is a XT 1033 - MotoG 1st Edition with Android 5.0.2), flutter run

Logs

Logs
 jckodel@mac  ~/foobar  flutter run                                                                                                             ✔  19:55:53
Multiple devices found:
XT1033 (mobile)                      • 0423490246                           • android-arm    • Android 5.0.2 (API 21)
iPod touch (7th generation) (mobile) • BDDD58F5-7397-4868-ABA8-81946FA2F9B8 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
Chrome (web)                         • chrome                               • web-javascript • Google Chrome 87.0.4280.88
[0]: XT1033 (0423490246)
[1]: iPod touch (7th generation) (BDDD58F5-7397-4868-ABA8-81946FA2F9B8)
[2]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 0
Launching lib/main.dart on XT1033 in debug mode...
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        25.0s
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...                41.6s
E/AndroidRuntime(17794): FATAL EXCEPTION: main
E/AndroidRuntime(17794): Process: com.example.foobar, PID: 17794
E/AndroidRuntime(17794): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.foobar/com.example.foobar.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable-v21/launch_background.xml from drawable resource ID #0x7f040000
E/AndroidRuntime(17794): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314)
E/AndroidRuntime(17794): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2388)
E/AndroidRuntime(17794): 	at android.app.ActivityThread.access$800(ActivityThread.java:148)
E/AndroidRuntime(17794): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
E/AndroidRuntime(17794): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(17794): 	at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(17794): 	at android.app.ActivityThread.main(ActivityThread.java:5312)
E/AndroidRuntime(17794): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17794): 	at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(17794): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
E/AndroidRuntime(17794): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
E/AndroidRuntime(17794): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-v21/launch_background.xml from drawable resource ID #0x7f040000
E/AndroidRuntime(17794): 	at android.content.res.Resources.loadDrawableForCookie(Resources.java:2431)
E/AndroidRuntime(17794): 	at android.content.res.Resources.loadDrawable(Resources.java:2333)
E/AndroidRuntime(17794): 	at android.content.res.Resources.getDrawable(Resources.java:758)
E/AndroidRuntime(17794): 	at android.content.res.Resources.getDrawable(Resources.java:724)
E/AndroidRuntime(17794): 	at io.flutter.embedding.android.FlutterActivity.getSplashScreenFromManifest(FlutterActivity.java:493)
E/AndroidRuntime(17794): 	at io.flutter.embedding.android.FlutterActivity.provideSplashScreen(FlutterActivity.java:469)
E/AndroidRuntime(17794): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onCreateView(FlutterActivityAndFragmentDelegate.java:301)
E/AndroidRuntime(17794): 	at io.flutter.embedding.android.FlutterActivity.createFlutterView(FlutterActivity.java:518)
E/AndroidRuntime(17794): 	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:415)
E/AndroidRuntime(17794): 	at android.app.Activity.performCreate(Activity.java:5953)
E/AndroidRuntime(17794): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128)
E/AndroidRuntime(17794): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
E/AndroidRuntime(17794): 	... 10 more
E/AndroidRuntime(17794): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #4: <item> tag requires a 'drawable' attribute or child tag defining a drawable
E/AndroidRuntime(17794): 	at android.graphics.drawable.LayerDrawable.inflateLayers(LayerDrawable.java:202)
E/AndroidRuntime(17794): 	at android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:147)
E/AndroidRuntime(17794): 	at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1095)
E/AndroidRuntime(17794): 	at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1017)
E/AndroidRuntime(17794): 	at android.content.res.Resources.loadDrawableForCookie(Resources.java:2421)
E/AndroidRuntime(17794): 	... 21 more
Error connecting to the service protocol: _flutter.listViews: (-32000) Bad state: The client closed with pending request "_flutter.listViews".
 jckodel@mac  ~/foobar  flutter doctor -v                                                                                                                                                                                   ✔  19:59:48
[✓] Flutter (Channel beta, 1.25.0-8.1.pre, on macOS 11.1 20C69 darwin-x64, locale en-BR)
    • Flutter version 1.25.0-8.1.pre at /Users/jckodel/flutter
    • Framework revision 8f89f6505b (2 weeks ago), 2020-12-15 15:07:52 -0800
    • Engine revision 92ae191c17
    • Dart version 2.12.0 (build 2.12.0-133.2.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/jckodel/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/jckodel/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.0

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

[✓] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.0

[✓] Connected device (3 available)
    • XT1033 (mobile)                      • 0423490246                           • android-arm    • Android 5.0.2 (API 21)
    • iPod touch (7th generation) (mobile) • BDDD58F5-7397-4868-ABA8-81946FA2F9B8 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • Chrome (web)                         • chrome                               • web-javascript • Google Chrome 87.0.4280.88

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolee: OS-version specificAffects only some versions of the relevant operating systeme: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions