Nativescript: Followed the steps in Chapter 1β€”Getting Up and Running... but getting build error while run

Created on 14 Nov 2016  Β·  16Comments  Β·  Source: NativeScript/NativeScript

Please, provide the details below:

D:\Source-Code\NativeScript\sample-Groceries>tns run android --emulator
Starting Android emulator with image N4
Waiting for emulator device initialization....
Executing before-prepare hook from D:\Source-Code\NativeScript\sample-Groceries\
hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Project successfully prepared (android)

:config phase:  createDefaultIncludeFiles
        +found plugins: tns-core-modules-widgets

:config phase:  createPluginsConfigFile
         Creating product flavors include.gradle file in D:\Source-Code\NativeSc
ript\sample-Groceries\platforms\android/configurations folder...

:config phase:  pluginExtend
        +applying configuration from: D:\Source-Code\NativeScript\sample-Groceri
es\platforms\android\configurations\include.gradle
        +applying configuration from: D:\Source-Code\NativeScript\sample-Groceri
es\platforms\android\configurations\tns-core-modules-widgets\include.gradle

:config phase:  copyAarDependencies

:config phase:  addAarDependencies
        +adding dependency: D:\Source-Code\NativeScript\sample-Groceries\platfor
ms\android\libs\aar\widgets-release.aar
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preF0DebugBuild UP-TO-DATE
:checkF0DebugManifest
:preF0ReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:prepareGroceriesRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0DebugDependencies
:compileF0DebugAidl UP-TO-DATE
:compileF0DebugRenderscript UP-TO-DATE
:generateF0DebugBuildConfig UP-TO-DATE
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:asbg:generateInterfaceNamesList
Exception in thread "main" java.net.MalformedURLException: no !/ in spec
        at java.net.URL.<init>(URL.java:627)
        at java.net.URL.<init>(URL.java:490)
        at java.net.URL.<init>(URL.java:439)
        at com.ig.GetInterfaceNames.getClassLoader(GetInterfaceNames.java:94)
        at com.ig.GetInterfaceNames.generateInterfaceNames(GetInterfaceNames.jav
a:51)
        at com.ig.GetInterfaceNames.main(GetInterfaceNames.java:35)
Caused by: java.lang.NullPointerException: no !/ in spec
        at sun.net.www.protocol.jar.Handler.parseAbsoluteSpec(Handler.java:171)
        at sun.net.www.protocol.jar.Handler.parseURL(Handler.java:151)
        at java.net.URL.<init>(URL.java:622)
        ... 5 more
:asbg:generateInterfaceNamesList FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Source-Code\NativeScript\sample-Groceries\platforms\android\build
-tools\android-static-binding-generator\build.gradle' line: 33

* What went wrong:
Execution failed for task ':asbg:generateInterfaceNamesList'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_112\bin\java.exe'' finished w
ith non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 17.947 secs
Command D:\Source-Code\NativeScript\sample-Groceries\platforms\android\gradlew.b
at failed with exit code 1
# run android
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Usage          β”‚ Synopsis                                                 β”‚
β”‚ Run on all     β”‚ $ tns run android [--key-store-path <File Path> --key    β”‚
β”‚ connected      β”‚ -store-password <Password> --key-store-alias <Name> -    β”‚
β”‚ devices and    β”‚ -key-store-alias-password <Password>] [--release] [-     β”‚
β”‚ running        β”‚ -justlaunch]                                             β”‚
β”‚ emulators      β”‚                                                          β”‚
β”‚ Run on a       β”‚ $ tns run android --device <Device ID> [--key-store-path β”‚
β”‚ selected       β”‚ <File Path> --key-store-password <Password> --key-store  β”‚
β”‚ connected      β”‚ -alias <Name> --key-store-alias-password <Password>] [-  β”‚
β”‚ device or      β”‚ -release] [--justlaunch]                                 β”‚
β”‚ running        β”‚                                                          β”‚
β”‚ emulator       β”‚                                                          β”‚
β”‚ Start an       β”‚ $ tns run android --emulator [<Emulator Options>] [--key β”‚
β”‚ emulator and   β”‚ -store-path <File Path> --key-store-password <Password>  β”‚
β”‚ run the app    β”‚ --key-store-alias <Name> --key-store-alias-password      β”‚
β”‚ inside it      β”‚ <Password>] [--release] [--justlaunch]                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Runs your project on a connected Android device or in a native Android emulator,
 if configured. This is shorthand for prepare, build and deploy. While your app
is running, prints the output from the application in the console.

### Options

    * --watch - If set, when you save changes to the project, changes are automa
tically synchronized to the connected device.
    * --device - Specifies a connected device on which to run the app.
    * --emulator - If set, runs the app in a native emulator for the target plat
form, if configured. When set, you can also set any other valid combination of e
mulator options as listed by $ tns help emulate android.
    * --release - If set, produces a release build. Otherwise, produces a debug
build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) whic
h you want to use to code sign your APK. You can use the --key-store-* options a
long with --release to produce a signed release build. You need to specify all -
-key-store-* options.
    * --key-store-password - Provides the password for the keystore file specifi
ed with --key-store-path. You can use the --key-store-* options along with --rel
ease to produce a signed release build. You need to specify all --key-store-* op
tions.
    * --key-store-alias - Provides the alias for the keystore file specified wit
h --key-store-path. You can use the --key-store-* options along with --release t
o produce a signed release build. You need to specify all --key-store-* options.

    * --key-store-alias-password - Provides the password for the alias specified
 with --key-store-alias-password. You can use the --key-store-* options along wi
th --release to produce a signed release build. You need to specify all --key-st
ore-* options.
    * --justlaunch - If set, does not print the application output in the consol
e.

Attributes

* <Device ID> is the index or name of the target device as listed by $ tns d

evice android
* is any valid combination of options as listed by $ tns
help emulate android

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Tell us about the problem

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Which platform(s) does your issue occur on?

iAndroid

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.3.0
  • Cross-platform modules: 2.3.0
  • Runtime(s): 2.3.0
  • Plugin(s): "name": "Groceries",
    "version": "1.0.0",

Please tell us how to recreate the issue in as much detail as possible.

tns platform remove android
tns platform add android
tns build android or tns run android --emulator

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem. NO..

android question

All 16 comments

Hey @munavargit

Can you tell us which branch of sample-Groceries you are using!? Is it _master_ or _angular-start_!?
Are you running the application after a clean clone of the repository or perhaps, you have some added libraries or/and modules to your local app!?

Also, can you try the following steps in order to clean and rebuild your entire project?

rm -rf node_modules
rm -rf platforms
git checkout angular-start  // or whatever branch you are looking for
git pull
npm cache clean
npm install
tns platform add android
tns run android 

Hi Nick lliev,

It is angular-start.

  1. git clone https://github.com/NativeScript/sample-Groceries.git
  2. cd sample-Groceries
  3. git checkout angular-start

I have followed your steps, instead of rm (i'm using W7), i did manually deleted the node_module and platform folders.

I followed the rest of steps,

D:\Source-Code\NativeScript\sample-Groceries>rm
'rm' is not recognized as an internal or external command,
operable program or batch file.

D:\Source-Code\NativeScript\sample-Groceries>git checkout angular-start
M package.json
M tsconfig.json
Already on 'angular-start'
Your branch is up-to-date with 'origin/angular-start'.

D:\Source-Code\NativeScript\sample-Groceries>git pull
Already up-to-date.

D:\Source-Code\NativeScript\sample-Groceries>npm cache clean

D:\Source-Code\NativeScript\sample-Groceries>npm install

[email protected] postinstall D:\Source-Code\NativeScript\samp
le-Groceriesnode_modulesnativescript-dev-typescript
node postinstall.js

Hook already installed: nativescript-dev-typescript
Hook already installed: nativescript-dev-typescript

Project already targets TypeScript ^1.8.10

[email protected] postinstall D:\Source-Code\NativeScript\sample-Groc
eriesnode_modulesnativescript-angular
node postinstall.js
....
...
...

when built, it is same error.

FYI! this is the first time, i''m trying, i'm fairly new to this.

Best Regards,
Munavar Hussain

On Mon, Nov 14, 2016 at 7:59 PM, Nick Iliev [email protected]
wrote:

Hey @munavargit https://github.com/munavargit

Can you tell us which branch of sample-Groceries you are using!? Is it
_master_ or _angular-start_!?

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NativeScript/NativeScript/issues/3091#issuecomment-260348576,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWRSwgjK9NLrJn50SvODkyvOxCzzDITWks5q-HA0gaJpZM4KxUwV
.

Hey @munavargit

I am suspecting some local configuration problem - could you please send us more infomration about your environment settings. Can you run tns doctor and verify if there are any error reports?

Hi Nick Iliev,

My operating system is W7, API level : 22, AVD: Google APIs Intel Atom
(x86), Node: v4.6.0.

JAVA SDK: jdk1.8.0_112

Android SDK build-tools: 23.0.3

tns doctor is all good, please see below,

C:\Users........>tns doctor
NOTE: You can develop for iOS only on Mac OS X systems.
To be able to work with iOS devices and projects, you need Mac OS X
Mavericks or
later.

Your components are up-to-date.

No issues were detected.

Please let me know, if you need any more specific detail.

Best Regards,
Munavar Hussain

On Tue, Nov 15, 2016 at 2:46 PM, Nick Iliev [email protected]
wrote:

Hey @munavargit https://github.com/munavargit

I am suspecting some local configuration problem - could you please send
us more infomration about your environment settings. Can you run tns
doctor and verify if there are any error reports?

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NativeScript/NativeScript/issues/3091#issuecomment-260588009,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWRSwtwgk6UevNnOPAAA5KJMpd3bEXl5ks5q-Xh8gaJpZM4KxUwV
.

@munavargit

I have tested sample-Groceries angular-start branch with the exact same settings using node 4.6 and almost identical version of JAVA SDK but wasn't able to reproduce this error. Your environment settings seem to be configured as expected, so can you try to run a basic project and see if you can deploy it ?

for example in empty folder create a basic angular project

tns create myTest --ng

and then with open emulator run

tns run android

Bad luck, same error :(.

On Tue, Nov 15, 2016 at 5:33 PM, Nick Iliev [email protected]
wrote:

@munavargit https://github.com/munavargit

I have tested sample-Groceries angular-start branch with the exact same
settings using node 4.6 and almost identical version of JAVA SDK but wasn't
able to reproduce this error. Your environment settings seem to be
configured as expected, so can you try to run a basic project and see if
you can deploy it ?

for example in empty folder create a basic angular project

tns create myTest --ng

and then with open emulator run

tns run android

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NativeScript/NativeScript/issues/3091#issuecomment-260623695,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWRSwr7RXHAqMhtjVRxhjnUcjk9Gbrxiks5q-Z96gaJpZM4KxUwV
.

I have the same problem, it seems it only occurs on Windows.

Any suggestion to resolve this issue?

I have the same issue. However running on Linux (Antergos).
node: v7.2.0
npm: v4.0.2
tns: v2.4.0
openjdk: v1.8.0_112
Android:

  • SDK tools: v25.2.3
  • Platform tools: v25.0.1
  • Build-tools: v25.0.1, v25 & v24.0.3

Same process:
tns create testNS
tns platform add android
tns build android

Same error as reported above:

:asbg:generateInterfaceNamesList Exception in thread "main" java.net.MalformedURLException: no !/ in spec

tns doctor reports all is fine and up to date.

I have also tried it with the Groceries sample and same issue.

Mine works fine if I run it on Ubuntu on a VM, but still can't find a solution to why it is not working on our machines.

Hey @PenguinLab I noticed that you are using the experimental version of Node.js, not the LTS (latest stable one) which is 6.9.2. Perhaps, you can try with 6.9.2.

@munavargit what is your Node.js version - can you try this as well if you are using 7.x

Hey, guys, I am closing this due to inactivity but please let me know if you still experience this issue with sample-Groceries. I have tested the tutorial up to chapter 4.3 and if you are interested you can try this solution here

Hi NIck,

Since I'm busy, I could not continue this, surely, will let you know, once
i get time.

On Tue, Dec 20, 2016 at 1:07 PM, Nick Iliev notifications@github.com
wrote:

Closed #3091 https://github.com/NativeScript/NativeScript/issues/3091.

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NativeScript/NativeScript/issues/3091#event-899722285,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWRSwkU783i5-BZXLsZLMrF1TwrsLTp-ks5rJ4XRgaJpZM4KxUwV
.

do you have a special character in one of your project folders?

I had the same problem and it was because the parent folder of the project has a '#' in the name. Removing it resolves the problem. thanks @curlyfro

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pourya8366 picture Pourya8366  Β·  3Comments

NickIliev picture NickIliev  Β·  3Comments

minjunlan picture minjunlan  Β·  3Comments

Leo-lay picture Leo-lay  Β·  3Comments

rLoka picture rLoka  Β·  3Comments