Build failing on Android


#1

Exception in thread “main” java.io.FileNotFoundException: C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\bindings.txt (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at org.nativescript.staticbindinggenerator.Generator.getRows(Generator.java:122)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:65)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:50)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:15)
:asbg:generateBindings FAILED

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\build.gradle’ line: 251

  • What went wrong:
    Execution failed for task ‘:asbg:generateBindings’.

Process ‘command ‘C:\Program Files\Java\jdk1.8.0_131\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.

BUILD FAILED

Total time: 26.647 secs
Multiple errors were thrown:
Command gradlew.bat failed with exit code 1


Can someone please shed some light as to what is wrong ? I had a great run on iOS, XCode works magic, the app is published on App Store now and works fine, but moving to Android - HURDLES. ALL. THE. WAY.

Honestly, setting up the environment that actually builds successfully seems next to impossible right now.

The worst part is I actually have all the code ready, it’s right there in the App folder, just to get my PC to build it seems to be the worst task I had in years.

I have set up everything as the article on Nativescript.org suggests.

Node 6.11.0
NPM 5.0.3
TNS 3.0.3

Thanks for any directions.


#2

generateBindings is only one of the build steps of the whole android build process. The build errors out because it fails to find a file that should normally be output during the previous build step.

You could share the whole build log or tns build android --log trace > buildlog.txt the more verbose one. Before doing that ensure the platform is cleaned by platform removing and readding it to ensure no previous build artifacts pollute the build logs.


#3

Thank you Pete. Please find below the output.


C:\nativescript-projects\Hub>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.

C:\nativescript-projects\Hub>tns build android --log trace > buildlog.txt
10:00:27.029 [ERROR] [system.err] Exception in thread "main"
java.io.FileNotFoundException: C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\bindings.txt (The system cannot find the file specified)
10:00:27.030 [ERROR] [system.err] at java.io.FileInputStream.open0(Native Method)
10:00:27.030 [ERROR] [system.err] at java.io.FileInputStream.open(FileInputStream.java:195)
10:00:27.030 [ERROR] [system.err] at java.io.FileInputStream.(FileInputStream.java:138)
10:00:27.030 [ERROR] [system.err] at java.io.FileInputStream.(FileInputStream.java:93)
10:00:27.030 [ERROR] [system.err] at org.nativescript.staticbindinggenerator.Generator.getRows(Generator.java:122)
10:00:27.030 [ERROR] [system.err] at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:65)
10:00:27.030 [ERROR] [system.err] at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:50)
10:00:27.030 [ERROR] [system.err] at org.nativescript.staticbindinggenerator.Main.main(Main.java:15)
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file ‘C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\build.gradle’ line: 251
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
10:00:27.064 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ‘:asbg:generateBindings’.
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process ‘command ‘C:\Program Files\Java\jdk1.8.0_131\bin\java.exe’’ finished with non-zero exit value 1
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:asbg:generateBindings’.
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
10:00:27.065 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
10:00:27.066 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
10:00:27.067 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.util.Swapper.swap(Swapper.java:38)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.8.0_131\bin\java.exe’’ finished with non-zero exit value 1
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.file.DefaultFileOperations.javaexec(DefaultFileOperations.java:170)
10:00:27.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.project.DefaultProject.javaexec(DefaultProject.java:943)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.groovy.scripts.DefaultScript.javaexec(DefaultScript.java:229)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:382)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.metaobject.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:170)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at build_96np1iqpa1o6ytkm4i258594l$_run_closure6$_closure17.doCall(C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\build.gradle:251)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:596)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:577)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] … 70 more
10:00:27.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
Error: Command gradlew.bat failed with exit code 1
at ChildProcess.childProcess.on (C:\Users\David\AppData\Roaming\npm\node_modules\nativescript\lib\common\child-process.js:112:36)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:891:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)


#4

Sorry Pete, I realized I didn’t attach the file. However I can’t upload as the site is refusing the file type. Tried adding it here as plain text - 500 Error on the site. It’s just too big, 977kB. Can I send it to you in some other way?


#5

Please use a third-party cloud storage provider like Google Drive or Dropbox to share it.


#6

Thanks, here it is.


#7

The javascript parser failed during the build. I have yet to find out why it didn’t error out.

I suggest you tns platform remove android, remove node_modules, npm cache clean and tns run again to let everything download again, fresh from npm.

All input files are considered out-of-date for incremental task ':asbg:runAstParser'.
12:45:33.121 [QUIET] [system.out] Running full build
12:45:33.336 [QUIET] [system.out] gave the following error: 
12:45:33.337 [QUIET] [system.out] [ERROR] module.js:471
12:45:33.337 [QUIET] [system.out]     throw err;
12:45:33.337 [QUIET] [system.out]     ^
12:45:33.337 [QUIET] [system.out] 
12:45:33.337 [QUIET] [system.out] Error: Cannot find module 'lodash/array/compact'
12:45:33.337 [QUIET] [system.out]     at Function.Module._resolveFilename (module.js:469:15)
12:45:33.337 [QUIET] [system.out]     at Function.Module._load (module.js:417:25)
12:45:33.337 [QUIET] [system.out]     at Module.require (module.js:497:17)
12:45:33.337 [QUIET] [system.out]     at require (internal/module.js:20:19)
12:45:33.337 [QUIET] [system.out]     at Object.<anonymous> (C:\nativescript-projects\Hub\node_modules\babel-types\lib\index.js:42:27)
12:45:33.337 [QUIET] [system.out]     at Module._compile (module.js:570:32)
12:45:33.338 [QUIET] [system.out]     at Object.Module._extensions..js (module.js:579:10)
12:45:33.338 [QUIET] [system.out]     at Module.load (module.js:487:32)
12:45:33.338 [QUIET] [system.out]     at tryModuleLoad (module.js:446:12)
12:45:33.338 [QUIET] [system.out]     at Function.Module._load (module.js:438:3)
12:45:33.338 [QUIET] [system.out] 
12:45:33.338 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
12:45:33.338 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':asbg:runAstParser'

#8

Thank you, I did as you said and this is the outcome after first build.



:asbg:runAstParser
Running full build
gave the following error:
[ERROR] module.js:471
throw err;
^

Error: Cannot find module 'lodash/array/compact’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (C:\nativescript-projects\Hub\node_modules\babel-types\lib\index.js:42:27)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

:asbg:generateBindings
Exception in thread “main” java.io.FileNotFoundException: C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\bindings.txt (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at org.nativescript.staticbindinggenerator.Generator.getRows(Generator.java:122)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:65)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:50)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:15)
:asbg:generateBindings FAILED

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\nativescript-projects\Hub\platforms\android\build-tools\android-static-binding-generator\build.gradle’ line: 251

  • What went wrong:
    Execution failed for task ‘:asbg:generateBindings’.

Process ‘command ‘C:\Program Files\Java\jdk1.8.0_131\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.

BUILD FAILED

Total time: 11.396 secs
Multiple errors were thrown:
Command gradlew.bat failed with exit code 1


#9

The dev dependency babel-types has a dependency on lodash, both should be installed in node_modules, but it appears that lodash either isn’t installed, or it’s the wrong, or incomplete version. Alternatively you could install lodash as a dev-dependency to your project, and see if babel-types picks it up.

What node and npm versions do you use?


#10

Good suggestion! I added lodash as a dev dependency and the app builds now and it starts failing at runtime in the emulator with:

Error:com.tns.NativeScriptException: Failed to find module: “lodash”, relative to: app/tns_modules/


#11

Seeing that you are using npm 5 - that could be the thing causing babel-types to fail.

As for the runtime error - that should not be happening at all unless you are importing lodash somewhere in your code, and lodash is NOT installed as a production (just ‘dependency’ entry) dependency in the ‘package.json’ of your project.


#12

Right you are. When added as dependency, lodash imports correctly and the app builds fine, even with NPM 5.

Thank you for bearing with me, much appreciated.


#13

Glad to hear you are up and running!

One more thing - do you actually import and use lodash anywhere in your app? Because if the answer is a negative - you could install ldoash just as a dev-dependency, so you won’t have to package it along with your other scripts - that will only increase the final package size.


#14

Yes I’m using lodash in my app, guess I have to stick with it for the time being.


#15

Hi,
I’m facing the same issue. Can you please tell me which version of lodash did you installed?
Did you install lodash as both production and dev-dependencies?

My stats:

node: 7.10
npm 5.0.3
nativescript: 3.1.1