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

Opening Android standalone app from phone home screen restarts app from start #2000

Closed
kelvinlawson opened this issue Jul 17, 2018 · 15 comments
Assignees
Labels

Comments

@kelvinlawson
Copy link

Environment

Environment:
OS: macOS High Sierra 10.13.5
Node: 7.6.0
Yarn: 1.3.2
npm: 4.6.1
Watchman: 4.7.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
expo: ^28.0.0 => 28.0.0
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz => 0.55.4

Diagnostics report:
https://exp-xde-diagnostics.s3.amazonaws.com/lisden-680ec40f-730b-44ec-816e-eda91c5fd36b.tar.gz

Android standalone APK. Running on Pixel 2.

Steps to Reproduce

(Write your steps here:)

  1. Generate fresh Expo template app "Tab Navigation"
  2. Add android.package name to app.json so that can create an APK
  3. exp build:android
  4. Install APK on phone
  5. Press app icon to launch app. Navigate to Settings screen.
  6. Press phone home button to background the app.
  7. Press app icon again to launch app.

Expected Behavior

App should open up at the last screen (Settings screen).

Actual Behavior

App restarts from the first screen, going through splash screen while it reloads.

If you use the Android application switcher to swap back to the app, it is still on the last screen as it should be.

Also if you click a push notification then it reopens at the last position as it should (there are no push notifications in the Expo template app but I proved this on another app).

Reproducible Demo

Built APK (which is just the standard Expo "Tab Navigation" template app): https://www.dropbox.com/s/4m04170r8ufsh68/rntemplate2.apk?dl=0

@kelvinlawson kelvinlawson changed the title Opening Android standalone app from phone home screen restarts from first screen Opening Android standalone app from phone home screen restarts app from start Jul 17, 2018
@brentvatne
Copy link
Member

brentvatne commented Jul 17, 2018

hi there! I followed your steps to reproduce (except used the apk you provided rather than building one) and I couldn't reproduce the problem. see the video below (might take a minute to load, it's a 15mb gif)

lol

any suggestions?

@brentvatne brentvatne added the needs more info To be used when awaiting reporter response label Jul 17, 2018
@kelvinlawson
Copy link
Author

Hi, thanks for the quick reply.

Can you share your APK with me, please, so that I can test whether it's the phone or the APK that is different?

Thanks

@brentvatne
Copy link
Member

brentvatne commented Jul 17, 2018

hi @kelvinlawson - it's the apk that you posted under the "Reproducible demo" heading of your post

@kelvinlawson
Copy link
Author

Ah, sorry I read it as same steps except not using my APK.

It looks like it must be device-related then, I'll test the APK on a few more Androids & report back. Thanks!

@kelvinlawson
Copy link
Author

OK tested on a few devices:

  • Physical Pixel 2 Android 8.1.0 - Broken
  • Physical Nexus 9 Android 7.1.1 - Broken
  • Genymotion Nexus 9 Android 7.1.0 - Working
  • Genymotion Nexus 5X Android 7.1.0 - Working
  • Physical Samsung XCover 4 Android 7.0.0 - Working
  • Physical Alcatel Pixi4 Android 6.0.0 - Working

So it seems like it is device-specific.

@brentvatne
Copy link
Member

thanks @kelvinlawson! @esamelson @jesseruder - ping

@brentvatne brentvatne added Android and removed needs more info To be used when awaiting reporter response labels Jul 18, 2018
@kr31n3r
Copy link

kr31n3r commented Jul 18, 2018

Some additional hints based on my testing:

  • restarting the device seems to help
  • it's always broken if Expo.Updates.reload() is triggered before:
  1. Start a standalone app that uses Expo.Updates.reload()
  2. Within that app trigger Expo.Updates.reload()
  3. Navigate somewhere (after reload)
  4. Press phone home button to background the app
  5. Press app icon again to launch app

@kelvinlawson
Copy link
Author

I also see it after previously running Expo.Updates.reload().

@esamelson
Copy link
Contributor

Hi all -- thanks for the info. We've been able to repro this on Pixel 2 and are looking into it.

@esamelson
Copy link
Contributor

We've landed a fix internally which will ship with the next release. Once SDK 29 comes out (likely next week), you can just rebuild your app and it will include this fix -- no need to actually upgrade to 29. Thanks again for reporting this!

@kelvinlawson
Copy link
Author

Thanks a lot!

Does this also fix the similar issue where it happens after Expo.Updates.reload()?

@esamelson
Copy link
Contributor

@kelvinlawson yes it should fix that issue as well.

@kr31n3r
Copy link

kr31n3r commented Jul 29, 2018

hi all,

i just published an updated version of my app and can confirm that all issues regarding "unwanted app restarting" have been fixed. I tested Expo.Updates.reload() as well.

Thanks a lot and keep up the good work!

@esamelson
Copy link
Contributor

Awesome, thanks for letting us know :) Closing this as resolved.

@MuhammadUmairghufran
Copy link

Only on Android device - after navigate to specific route like profile screen it's re start the whole app on expo please help me - another side IOS devices working absolutely fine

@lock lock bot added the outdated label Jul 1, 2019
@lock lock bot locked and limited conversation to collaborators Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants