Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android App crash on start after upgrading to 0.59.8 #25024

Closed
BasilJohn opened this issue May 24, 2019 · 6 comments
Closed

Android App crash on start after upgrading to 0.59.8 #25024

BasilJohn opened this issue May 24, 2019 · 6 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@BasilJohn
Copy link

I upgraded react native from 0.56 to 0.59.8 using the rn diff tool.
The code builds successfully however the app crashes immediately after launch.

React Native version:
React Native : 0.59.8

Steps To Reproduce

1.Upgrade to RN 0.59.8 using RN DIFF tool
2.Run command "react-native run-android"

I get the below error when i do a logcat from Android Studio.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.libertyhk.eClaim/com.libertyhk.eClaim.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Though the android:theme is using AppCompat i still see the same issue.

---Below ins my styles.xml file

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
</style>

<!--<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">-->
    <!--<item name="android:windowBackground">@drawable/background_splash</item>-->
<!--</style>-->

<style name="SplashTheme" parent="AppTheme">
    <item name="android:windowBackground">@drawable/background_splash</item>
</style>

Describe what you expected to happen:
Expected behaviour to get the app running on android.

@BasilJohn BasilJohn added the Bug label May 24, 2019
@react-native-bot react-native-bot added the Platform: Android Android applications. label May 24, 2019
@ferrannp
Copy link
Contributor

@BasilJohn can you show me how you use SplashTheme and AppTheme in your AndroidManifest.xml ?

@BasilJohn
Copy link
Author

application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"

@guhungry
Copy link
Contributor

Did you try clean android build cache after upgrade?

@ferrannp
Copy link
Contributor

@BasilJohn remove android:theme from <application> tag and add it inside the <activity> tag. Let me know if it works.

@BasilJohn
Copy link
Author

@BasilJohn remove android:theme from <application> tag and add it inside the <activity> tag. Let me know if it works.

@ferrannp this works !!!! Thanks a lot for the support.

@ferrannp
Copy link
Contributor

No problem :)

@facebook facebook locked as resolved and limited conversation to collaborators May 27, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants