infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!
MIT License
17.32k stars 1.37k forks source link

Cannot run project on Android 8.0 #2719

Open janwiebe-jump opened 1 month ago

janwiebe-jump commented 1 month ago

Describe the bug

The app crashes immediately with an IllegalStateException: Only fullscreen opaque activities can request orientation

This is caused by the portrait in the Android Manifest, that is set in the app.json:

See: https://stackoverflow.com/questions/48072438/java-lang-illegalstateexception-only-fullscreen-opaque-activities-can-request-o for reference.

Removing the orientation from the app.json solves this issue.

Ignite version

7.15.0

Additional info

just regular

lindboe commented 1 month ago

Hi, thanks for the report!

I think this is a bug with Expo: app.json is an Expo tool, and Expo does say Android 6+ should be supported: https://docs.expo.dev/versions/latest/config/app/#orientation.

That said, I don't think we're likely to remove the orientation configuration in order to support Android 8; older Android support isn't often a priority for us. Maybe we should raise the minSdkVersion in the template instead. @frankcalise do you have thoughts on this?

frankcalise commented 1 month ago

@lindboe Agree, if this is just configuration needed for a specific project, then it should just be that. Maybe a discussion thread or recipe page on better support for Android 8.0?

But looking at that stack overflow, is it possible to address such an issue with a specific version of styles.xml? Because we do have a config plugin setting windowIsTranslucent to address an Android 12 issue.

image

So maybe we can achieve this with a more tailored plugin?

https://github.com/infinitered/ignite/blob/master/boilerplate/plugins/withSplashScreen.ts#L62-L74