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

bug: Android app crashes during startup #2652

Closed
3 tasks
dlehmhus opened this issue Mar 27, 2020 · 4 comments
Closed
3 tasks

bug: Android app crashes during startup #2652

dlehmhus opened this issue Mar 27, 2020 · 4 comments

Comments

@dlehmhus
Copy link

dlehmhus commented Mar 27, 2020

Bug Report

Capacitor Version

Installed Dependencies:
@capacitor/ios not installed
@capacitor/cli 1.5.2
@capacitor/core 1.5.2
@capacitor/android 1.5.2

Affected Platform(s)

  • [x ] Android
  • iOS
  • Electron
  • Web

Current Behavior

During app startup, the app crashes once, starts again and works fine from thereon. You don't notice the app crashing, rather than the splash screen turns completely white for a moment and comes back before revealing the app.

Expected Behavior

The app starts without crashing.

Sample Code or Sample Application Repo

https://github.com/dlehmhus/capacitor-android-example

Reproduction Steps

  1. npm i && npm run build && npx cap open android
  2. Start the App from Android Studio

Other Technical Details

npm: 6.12.1
node: v12.13.1
device: Samsung SM-G950F
Android: 8.0

Other Information

The error part of the stacktrace starts with
Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
The whole stacktrace can be found here: https://github.com/dlehmhus/capacitor-android-example/blob/master/stacktrace.txt

@dlehmhus dlehmhus changed the title bug: Android app crasher during startup bug: Android app crashes during startup Mar 27, 2020
@mcking49
Copy link

mcking49 commented Apr 4, 2020

Also having the same issue, Splash screen also "flickers" (different issue, but could be related)

@stripathix
Copy link

Remove the android folder and add it again. That fixes it for me. Also better update to the latest capacitor

@jcesarmobile
Copy link
Member

jcesarmobile commented Jun 3, 2020

I can't reproduce the crash, but I see those OnUnhandledKeyEventListenerWrapper messages.
That is a problem in Android X support libraries and has been fixed recently.
Update to Capacitor 2 following this guide https://capacitor.ionicframework.com/docs/android/updating#from-1-5-1-to-2-0-0
but update androidxAppCompatVersion to 1.3.0-alpha01 or androidxCoreVersion to 1.4.0-alpha01 instead of to the versions in that guide.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants