NativeScript/nativescript-cli

ns typings command error "parse error near `\n'"

ad-proximate opened this issue · 1 comments

Issue Description

I have a really small kotlin library to test how to import it into nativescript. I followed the steps of this page:
https://blog.nativescript.org/how-to-use-java-code-in-nativescript/
I've fallen down at the step when creating typings for ns. I'm getting always the same error: zsh: parse error near \n'`

Reproduction

The kotlin class:

`package com.example.mytestlibrary

class MyFirst {
fun getMySentence(): String {
return "Lorem Ipsum"
}
}`

I've built an .aar (attached) from the lib in Android Studio and unziped to access the jar file and put the files into NS project.

MyTestLibrary.aar.zip

If I run ns typings android –-jar <./libs/MyTestLibrary/classes.jar> I get this error: zsh: parse error near `\n'

I can't find out why?

Relevant log output (if applicable)

zsh: parse error near `\n'

Environment

OS: macOS 13.0.1
CPU: (8) arm64 Apple M2
Shell: /bin/zsh
node: 16.18.0
npm: 8.19.2
nativescript: 8.3.3

# android
java: 11.0.16.1
ndk: Not Found
apis: 31, 32, 33
build_tools: 30.0.3, 32.0.0, 33.0.0, 33.0.1
system_images: 
  - android-33 | Google APIs ARM 64 v8a

# ios
xcode: /undefined
cocoapods: 1.11.3
python: 3.10.8
python3: 3.10.8
ruby: 2.6.10
platforms: Not Found

Dependencies

"dependencies": {
  "@angular/animations": "~15.0.0",
  "@angular/common": "~15.0.0",
  "@angular/compiler": "~15.0.0",
  "@angular/core": "~15.0.0",
  "@angular/forms": "~15.0.0",
  "@angular/platform-browser": "~15.0.0",
  "@angular/platform-browser-dynamic": "~15.0.0",
  "@angular/router": "~15.0.0",
  "@nativescript/angular": "~15.0.0",
  "@nativescript/core": "~8.4.0",
  "@nativescript/theme": "~3.0.2",
  "rxjs": "~7.5.0",
  "zone.js": "~0.11.5"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~15.0.0",
  "@angular/cli": "^15.0.2",
  "@angular/compiler-cli": "~15.0.0",
  "@nativescript/android": "8.3.1",
  "@nativescript/types": "~8.4.0",
  "@nativescript/webpack": "~5.0.12",
  "@ngtools/webpack": "~15.0.0",
  "typescript": "~4.8.4"
}

Please accept these terms

zsh: parse error near `\n'

would come from the shell/zsh environment itself because of a misspelled command most likely.

I was able to generate the typings with the following:

ns create libTest --ts
# download MyTestLibrary.aar into libTest...

ns typings android --aar MyTestLibrary.aar

# output:
...
Android d.ts Generator Version : 3.0.0
Generation of definitions took 234ms.
Typings have been generated in the following directory: ./typings

image