react-native-bootsplash: [Android 12] App crashes on launch

Bug summary

Description

App crashes on launch in Android 12 emulator, but works fine in Android 13 emulator and iOS. Possibly related to #398 and #387

Libraries

react-native: 0.70.6 react-native-bootsplash: 4.3.3

Stack trace

FATAL EXCEPTION: main

Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f0403d4 a=-1}

FATAL EXCEPTION: main
Process: nz.co.newworld.clubcard.dev, PID: 8126
java.lang.RuntimeException: Unable to start activity ComponentInfo{nz.co.newworld.clubcard.dev/nz.co.newworld.clubcard.MainActivity}: android.view.InflateException: Binary XML file line #24 in nz.co.newworld.clubcard.dev:layout/splash_screen_view: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f0403d4 a=-1}
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3533)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3690)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:99)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2138)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7858)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:984)```

### Library version

4.3.3

### Environment info

```shell
System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1
    Memory: 102.95 MB / 16.00 GB
    Shell: 3.5.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.12.1 - ~/Library/Caches/fnm_multishells/98296_1669844938756/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/Library/Caches/fnm_multishells/98296_1669844938756/bin/npm
    Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/adrian/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: 14.1/14B47b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.6 => 0.70.6 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

  1. Create new react-native project from scratch
  2. Add react-native-bootsplash
  3. yarn android in Android 12 emulator
  4. App crashes

Reproducible sample code

Minimal runnable repo
https://github.com/adrianso/bootsplash-android12-crash

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@adrianso I’m glad we solved it. Thanks for the sponsorship! šŸ™‚

@zoontek I figured it out. Turned out that the version of Android I am using is SPP3.210325.010, which is the Developer Preview 3 build of Android 12. Since this is not a consumer facing version of Android, we can safely ignore this crash.

Thanks for your help!