-
-
Notifications
You must be signed in to change notification settings - Fork 198
Description
Problem:
If the gradle build fails, the CLI will continue executing, printing Project successfully built. Installing..., and will attempt to adb push an APK.
What this means is that if there is an APK available and a consecutive build fails, the older APK will be used, and the user may never learn that their build didn't complete successfully.
Versions:
CLI: @next
Android runtime: @next (3.0)
modules: any version
Steps to reproduce:
tns create crashMe
cd crashMe
tns platform add android@next
tns build/run android
tns plugin remove tns-core-modules
tns plugin add tns-core-modules@internal-preview
tns run android
OR
make changes to the 'build.gradle' in a task's execution phase to force an exception
tns run android
The run will output the following:
It becomes evident that the gradle build failed during asbg:generateBindings, and the output of the process is 'BUILD FAILED'. Despite that the build continues and deploys on device (provided there was an APK available previously)
$ tns run android
Searching for devices...
iTunes is not installed. Install it on your system and run this command again.
Skipping prepare.
Building project...
> Configuring > 0/3 projects > root project
:config phase: createDefaultIncludeFiles
+found plugins: tns-core-modules-widgets
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in D:\work\projects\crashMe\platforms\android/configurations folder...
:config phase: pluginExtend
+applying configuration from: D:\work\projects\crashMe\platforms\android\configurations\include.gradle
+applying configuration from: D:\work\projects\crashMe\platforms\android\configurations\tns-core-modules-widgets\include.gradle
:config phase: copyAarDependencies
> Configuring > 0/3 projects > root project
:config phase: addAarDependencies
+adding dependency: D:\work\projects\crashMe\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_479nsx45u4hr4psyx8xytrfgs.run(D:\work\projects\crashMe\platforms\android\build-tools\android-static-binding-generator\build.gradle:126)
:preBuild UP-TO-DATE
:preF0DebugBuild UP-TO-DATE
:checkF0DebugManifest
:preF0ReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2520Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72520Library UP-TO-DATE
:prepareComAndroidSupportDesign2520Library UP-TO-DATE
:prepareComAndroidSupportRecyclerviewV72520Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2520Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2520Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2520Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2520Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2520Library UP-TO-DATE
:prepareComAndroidSupportSupportV42520Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2520Library UP-TO-DATE
:prepareComAndroidSupportTransition2520Library UP-TO-DATE
:prepareCrashMeRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0DebugDependencies
:compileF0DebugAidl UP-TO-DATE
:compileF0DebugRenderscript UP-TO-DATE
:generateF0DebugBuildConfig UP-TO-DATE
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser UP-TO-DATE
:asbg:generateBindings
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
D:\work\projects\crashMe\platforms\android\src\main\java\com\tns\gen\android\content\BroadcastReceiver_frnal_ts_helpers_l58_c38__BroadcastReceiver.java
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:59)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:15)
:asbg:generateBindings FAILED
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\work\projects\crashMe\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_74\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: 3.561 secs
Project successfully built.
Installing...
Successfully installed on device with identifier '192.168.56.101:5555'.
Transferring project files...
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.crashMe on device 192.168.56.101:5555.
Executing before-watch hook from D:\work\projects\crashMe\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.1.6
11:27:39 AM - Compilation complete. Watching for file changes.