1
votes

I created a demo project and tried to run it against a genymotion android emulator in my company network. When i run "tns run android" i get this error as below:

tns run android
Searching for devices...
Executing before-liveSync hook from C:\projects\apps\tnsDemo\hooks\before-liveSync\nativescript-angular-sync.js
Skipping prepare.
Building project...
Gradle build...

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

:config phase:  createPluginsConfigFile
         Creating product flavors include.gradle file in C:\projects\apps\tnsDemo\platforms\android/configurations folder...

:config phase:  pluginExtend
        +applying configuration from: C:\projects\apps\tnsDemo\platforms\android\configurations\include.gradle
        +applying configuration from: C:\projects\apps\tnsDemo\platforms\android\configurations\tns-core-modules-widgets\include.gradle

 :config phase:  addAarDependencies
        +adding dependency: C:\projects\apps\tnsDemo\platforms\android\libs\aar\widgets-release.aar
Exception in thread "main" java.lang.IllegalArgumentException: There are no parameters passed!
        at com.ig.GetInterfaceNames.main(GetInterfaceNames.java:27)

FAILURE: Build failed with an exception.
  • Where: Build file 'C:\projects\apps\tnsDemo\platforms\android\build-tools\android-static-binding-generator\build.gradle' line: 69

  • What went wrong: Execution failed for task ':asbg:generateInterfaceNamesList'.

    Process 'command 'C:\Program Files\Java\jdk1.8.0_144\bin\java.exe'' finished with 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. Unable to apply changes on device: 192.168.92.101:5555. Error is: Command gradlew.bat failed with exit code 1. Executing after-watch hook from C:\projects\apps\tnsDemo\hooks\after-watch\nativescript-dev-typescript.js

Platform: Android Java version: 1.8.0_144" tns version: 3.2.1 tns-core-modules.d.ts: version: 3.1.1 tns-android: version: 3.2.0

Seems like something blocks the connection to the emulator but I don't know how to workaround it.

1
Do you observe this on just Genymotion? Because that exception is thrown during build, meaning your android libraries have not been iterated over. I'd advise removing your platform, node_modules, cleaning the npm cache, and trying to tns run again. - pkanev
Already tried that. Deleted everthing from nativescript, java and npm and installed it via the nativescript installer but nothing changed. - Flo
We've seen one or two other reports of the same problem, but have been unable to reproduce it on our ends. For the time being you could consider using NativeScript Sidekick to build your applications for you. - pkanev
@pkanev Works perfectly fine with NativeScript Sidekick. Thank you! I think the error above is somehow related to the network infrastructure setup. Maybe port isolation or something. - Flo
as @pkanev is pointing out, this issue is not related to the emulator. I am having the same both with emulator and device. I opened an issue here github but no answer yet - Seba92

1 Answers

0
votes

Seems like i found the origin of the problem. The exception is thrown when the "org.gradle.parallel" property in the gradle.properties file is set to true. When I set it to false everything works fine.