Skip to content

Error while trying to start application on Android emulator with API level Q #4451

Closed
@tsonevn

Description

@tsonevn

@neil-119 commented on Wed Mar 20 2019

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.2.4
  • Cross-platform modules: 5.2.2
  • Android Runtime: 5.2.1
  • iOS Runtime: 5.2.0
  • Plugin(s): Default package.json

Describe the bug
After tns run android, the application runs when opened manually, but we are unable to debug or see any console logs because the app fails to start:

Project successfully built.
Installing on device 8A9Y0G2BK...
Successfully installed on device with identifier '8A9Y0G2BK'.
Restarting application on device 8A9Y0G2BK...
Error while trying to start application org.nativescript.ngApp on device 8A9Y0G2BK. Error is: Invalid Version: null
Unable to start application org.nativescript.ngApp on device 8A9Y0G2BK. Try starting it manually.
Successfully synced application org.nativescript.ngApp on device 8A9Y0G2BK.

Below is a log trace from the newly created app:
https://gist.githubusercontent.com/neil-119/e8ecdc5d3d7036c78005033f3532ffb3/raw/632599f919cbf9cc360498d6103c8c9b65695c59/log.txt

To Reproduce

tns create ngApp --ng && cd ngApp
tns run android

Expected behavior
Application runs without error

Sample project
Default project when running tns create

Additional context
Note that we are running the latest beta build of Android Q on Google Pixel 3 XL.


@neil-119 commented on Wed Mar 20 2019

Update - works fine on our Android 9 (i.e. Android P) device. This issue seems to be associated with Android Q (tried on two different Android Q devices).


@NathanaelA commented on Wed Mar 20 2019

@neil-119 - Question for you; can you try a couple things if you have time.

  1. try tns create test --js && cd test then tns run android (i.e. try just a simple base app)
  2. Do you know if this fails on Android Q emulators? (yes)
  3. When you click on the icon on the phone, I assume it also crashes out, correct? (no, app runs fine)

@NathanaelA commented on Wed Mar 20 2019

I ran a couple tests on an Q emulator (don't have a real Q device).

The message:
Error is: Invalid Version: null
is from TNS CLI not the emulator. And the app runs fine, but logging from TNS is halted because of this error.

The easier way to see this is just do a tns device log

The actual device.deviceInfo retrieved from my emulator is:

{ identifier: 'emulator-5556',
  displayName: 'Pixel_2_API_Q',
  model: 'Android SDK built for x86',
  version: 'Q',
  vendor: 'google',
  platform: 'Android',
  status: 'Connected',
  errorHelp: null,
  isTablet: false,
  type: 'Emulator',
  imageIdentifier: 'Pixel_2_API_Q' }

The callstack is at:

    at new SemVer (/usr/local/lib/node_modules/nativescript/node_modules/semver/semver.js:291:24)
    at compare (/usr/local/lib/node_modules/nativescript/node_modules/semver/semver.js:581:10)
    at Function.gte (/usr/local/lib/node_modules/nativescript/node_modules/semver/semver.js:630:10)
    at LogcatHelper.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/mobile/android/logcat-helper.js:87:80)

On logcat-helper.js line 87; const isLogcatPidSupported = !!device.deviceInfo.version && semver.gte(semver.coerce(device.deviceInfo.version), minAndroidWithLogcatPidSupport);
So it is looking at device.deviceInfo.version of which version = 'Q' and so semVer throws that error, and of course fails out.

@NickIliev.- This issue needs to be moved to the CLI.

@neil-119 - You can do the following on Linux or Mac:
In the meantime you can do adb logcat | grep JS to see error from another terminal window....

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions