-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Error while trying to start application on Android emulator with API level Q #4451
Comments
This issue is persisting for me with Pixel 2 API 28 and Pixel 2 API 29, both running Android Q (10.0 x86). $ nativescript --version
7.0.11 |
This comment was marked as abuse.
This comment was marked as abuse.
Thanks for the pointer @NathanaelA. Is Android Q a beta release, do you mean? It’s a bit unclear to me. I also hadn’t expected to have been automatically given a beta release by Android Studio’s device / ADB manager. |
This comment was marked as abuse.
This comment was marked as abuse.
I could well have misread the API 28 one; maybe disregard that. The main thing is that it suffers the very same nondescript error on both my 28 and 29 virtual devices. Here's what my 29 device shows in AVD in Android Studio 4.1.1: And, when trying to create a new one: Not clear to me whether I'm getting a beta by accident. $ tns device log
Searching for devices...
Connected devices & emulators
┌───┬────────────────┬──────────┬──────────────────────────────────────┬──────────┬───────────┬─────────────────┐
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │ Connection Type │
│ 1 │ Pixel_2_API_29 │ Android │ emulator-5554 │ Emulator │ Connected │ Local │
│ 2 │ iPhone 8 Plus │ iOS │ F7839325-EC09-4316-A9ED-165EE3E597AE │ Emulator │ Connected │ Local │
└───┴────────────────┴──────────┴──────────────────────────────────────┴──────────┴───────────┴─────────────────┘ How did you print out your |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
@NathanaelA I've been looking into this. deviceInfo may have been a red herring. I understood that the error was ultimately coming from a call to
So the problem evidently begins here:
> console.log(`runtimePackage`, runtimePackage);
< { name: '@nativescript/android', version: null } So it's getting Here is the {
"main": "app.js",
"dependencies": {
"@nativescript/android": "file:../../node_modules/@nativescript/android",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"@nativescript/ios": "file:../../node_modules/@nativescript/ios",
"@react-navigation/core": "file:../../node_modules/@react-navigation/core",
"react": "file:../../node_modules/react",
"react-nativescript": "file:../../node_modules/react-nativescript",
"react-nativescript-navigation": "file:../../node_modules/react-nativescript-navigation",
},
"devDependencies": {
"@babel/core": "file:../../node_modules/@babel/core",
"@nativescript/webpack": "~3.0.0",
"@nativescript/types": "file:../../node_modules/@nativescript/types",
"@pmmmwh/react-refresh-webpack-plugin": "file:../../node_modules/@pmmmwh/react-refresh-webpack-plugin",
"@types/react": "file:../../node_modules/@types/react",
"babel-loader": "file:../../node_modules/babel-loader",
"fork-ts-checker-webpack-plugin": "file:../../node_modules/fork-ts-checker-webpack-plugin",
"react-refresh": "file:../../node_modules/react-refresh",
"typescript": "file:../../node_modules/typescript"
}
} ... these refer to the monorepo dependencies. The monorepo's {
"name": "plugins",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"postinstall": "node ./node_modules/husky/lib/installer/bin install && patch-package",
"setup": "npx rimraf node_modules package-lock.json dist tmp && npm i && ts-patch install",
"start": "nps",
"add": "nx g @nativescript/plugin-tools:add-package",
"add-angular": "nx g @nativescript/plugin-tools:add-angular",
"config": "nx g @nativescript/plugin-tools:config",
"publish-packages": "nx g @nativescript/plugin-tools:publish"
},
"private": true,
"devDependencies": {
"@angular/animations": "~10.1.0",
"@angular/common": "~10.1.0",
"@angular/compiler": "~10.1.0",
"@angular/compiler-cli": "~10.1.0",
"@angular/core": "~10.1.0",
"@angular/forms": "~10.1.0",
"@angular/platform-browser": "~10.1.0",
"@angular/platform-browser-dynamic": "~10.1.0",
"@angular/router": "~10.1.0",
"@babel/core": "^7.4.5",
"@nativescript/android": "7.0.1",
"@nativescript/angular": "~10.1.0",
"@nativescript/core": "~7.0.0",
"@nativescript/ios": "7.0.6",
"@nativescript/plugin-tools": "~1.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~3.0.0",
"@ngtools/webpack": "~10.1.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.0-beta.5",
"@react-navigation/core": "^5.13.2",
"@types/react": "16.9.34",
"babel-loader": "8.0.6",
"fork-ts-checker-webpack-plugin": "^5.1.0",
"husky": "^4.3.0",
"nativescript-vue": "~2.8.0",
"nativescript-vue-template-compiler": "~2.8.0",
"ng-packagr": "~10.1.0",
"patch-package": "^6.2.2",
"react": "^16.13.1",
"react-nativescript": "^2.1.0",
"react-nativescript-navigation": "^2.0.1",
"react-refresh": "^0.8.3",
"rxjs": "~6.6.0",
"typescript": "~4.0.0",
"zone.js": "0.11.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*": [
"nx format:write --files"
]
}
} So might this only affect monorepos? Unlike the NativeScript plugin seed, I've chosen to hoist the Android dependency in mine, as I couldn't see why it couldn't be hoistable – maybe that led to something breaking? |
Nope, I tried "unhoisting" it, and it still faces the same error. |
After unhoisting my $ tns doctor
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.2.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.11 version and is up to date.
✔ Component @nativescript/core has 7.0.13 version and is up to date.
✖ Component @nativescript/ios is not installed.
✖ Component @nativescript/android is not installed.
$ tns platform add android@7.0.1
Copying template files...
Platform android successfully added. v7.0.1
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.2.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.11 version and is up to date.
✔ Component @nativescript/core has 7.0.13 version and is up to date.
✖ Component @nativescript/ios is not installed.
✖ Component @nativescript/android is not installed. Pretty alarming that it still can't find Note that the $ tns plugin add my-cool-plugin
npm WARN react-reconciler@0.25.1 requires a peer of react@^16.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN @0.0.1 No description
npm WARN @0.0.1 No repository field.
npm WARN @0.0.1 No license field.
+ @nativescript-community/my-cool-plugin@1.0.0
updated 1 package and audited 901 packages in 4.853s
35 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[CLI!] projectData.projectDir /Users/jamie/Documents/git/my-monorepo/apps/demo-react
[CLI!] platform android
[CLI!] runtimePackage { name: '@nativescript/android', version: null }
[CLI!] installedFrameworkVersion null
[CLI!] pluginPlatformsData { ios: '6.0.0', android: '6.0.0' }
[CLI!] pluginPlatformsData[platform] 6.0.0
Trace: [CLI!] here boss
at new SemVer (/usr/local/lib/node_modules/nativescript/node_modules/semver/classes/semver.js:22:15)
at compare (/usr/local/lib/node_modules/nativescript/node_modules/semver/functions/compare.js:3:32)
at Object.gt (/usr/local/lib/node_modules/nativescript/node_modules/semver/functions/gt.js:2:29)
at PluginsService.isPluginDataValidForPlatform (/usr/local/lib/node_modules/nativescript/lib/services/plugins-service.js:421:29)
at PluginsService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/services/plugins-service.js:66:26)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/nativescript/lib/services/plugins-service.js:8:71
at new Promise (<anonymous>)
at __awaiter (/usr/local/lib/node_modules/nativescript/lib/services/plugins-service.js:4:12)
at action (/usr/local/lib/node_modules/nativescript/lib/services/plugins-service.js:65:83)
Invalid Version: null |
This comment was marked as abuse.
This comment was marked as abuse.
@NathanaelA Moved to here: #5444 |
@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 thepackage.json
of the project):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:Below is a log trace from the newly created app:
https://gist.githubusercontent.com/neil-119/e8ecdc5d3d7036c78005033f3532ffb3/raw/632599f919cbf9cc360498d6103c8c9b65695c59/log.txt
To Reproduce
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.tns create test --js && cd test
thentns run android
(i.e. try just a simple base app)@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:
The callstack is at:
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....The text was updated successfully, but these errors were encountered: