Skip to content

Release build with 5.3.0 crash on startup, but works with 5.2.1 (Android) #1341

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

Closed
apsaros opened this issue Apr 3, 2019 · 6 comments
Closed

Comments

@apsaros
Copy link

apsaros commented Apr 3, 2019

Environment
✔ Component nativescript has 5.3.1 version and is up to date.
✔ Component tns-core-modules has 5.3.1 version and is up to date.
✔ Component tns-android has 5.3.0 version and is up to date.
✔ Component tns-ios has 5.3.1 version and is up to date.

Using nativescript-vue.
See attached package.json below for more info (I've removed repo link etc.)

Tested on both physical (ONEPLUS A6013, Android 9) and virtual (Pixel 2 XL, Android 8.1) devices

Describe the bug
The app crashes on startup (both physical and virtual) if I build as a release on 5.3.0. However, I can successfully run a debug build on 5.3.0. Both the debug and release builds works if I downgrade to 5.2.1. All builds on iOS runs and executes successfully.

In summary for tns-android builds, tested on both physical and simulator:
5.3.0 release: fail
5.3.0 debug: ok
5.2.1 release: ok
5.2.1 debug: ok

I have of course nuked the project before each build:
rm -rf platforms node_modules
rm package-lock.json

As a side note (which might or might not be related to the issue) is that if I deploy the .apk on Google Play for internal testing, neither of the release build works. I can install the app but it never opens, so I guess it crashes immediately. Which is somehow weird, since I can get the 5.2.1 apk to work if it's not through Google Play.

Attachments
From tests on physical device, I've attached the stacktrace (errors only from the device), the logcat for 5.3.0 which fails and the working 5.2.1, as well as package.json:

package.json.txt
stacktrace.txt
logcat-5_3_0.txt
logcat-5_2_1.txt

@vmutafov
Copy link
Contributor

vmutafov commented Apr 4, 2019

Could you provide a sample application having this behaviour?

@apsaros
Copy link
Author

apsaros commented Apr 4, 2019

Thanks for the reply @vmutafov. The project is quite extensive, but maybe I can create a new small test project. I'll look into it later today. In the meantime, would the android manifest be of any help?

@vmutafov
Copy link
Contributor

vmutafov commented Apr 4, 2019

Although a sample application would be best, the manifest could give some insight on the problem.

@apsaros
Copy link
Author

apsaros commented Apr 4, 2019

Here's the manifest:
AndroidManifest.xml.txt

@apsaros
Copy link
Author

apsaros commented Apr 4, 2019

Yikes.. I've been trying to debug this issue for a week now, but it wasn't until I tried to recreate the issue in a new project that I noticed some of the differences to my original project.

  1. I had an old version of tns-core-modules (5.2.2) which never updated a long with the tns-android/-ios. I've now updated this to "tns-core-modules": "^5.3.1"
    However, this did not solve my issue, but probably was a cause to some of the errors.
  2. Next I found a discrepancy in the AndroidManifest.xml, where I had lost (during my previous efforts to enable deep linking) a quite vital line under "intent-filter":
    <category android:name="android.intent.category.LAUNCHER" />

This seemed to do the trick. I can now build a release with the latest tns-android (now 5.3.1) and I'm able to run it successfully on a device.

Thanks for the help, and especially all the work that you put into this project, it's really great stuff!
And as a note to myself.. trying to recreate the issue in a new project is a quite handy debug method :)

@apsaros apsaros closed this as completed Apr 4, 2019
@vmutafov
Copy link
Contributor

vmutafov commented Apr 5, 2019

Glad you fixed it :) Feel free to submit any issues you observe ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants