FAILURE: Build failed with an exception


#1

Hi,

I have only a month with native, maybe more. A week ego i make a mistake and suspend a “tns build android” with control+C. For more than a week I follow any recommendation of the web, specially the recommendation of delete the platform/android directory and build again. The last thing i do was uninstall android studio, java and node; create new user and install chocolatey and install all with the “choco” command

tns build android
Executing before-prepare hook from C:\Users\jorge\projects\date.anytime\hooks\before-prepare\nativescript-dev-android-snapshot.js
Executing before-prepare hook from C:\Users\jorge\projects\date.anytime\hooks\before-prepare\nativescript-plugin-firebase.js
Preparing project…
Successfully prepared plugin nativescript-chatview for android.
Successfully prepared plugin nativescript-dom for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-https for android.
Successfully prepared plugin nativescript-plugin-firebase for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-unit-test-runner for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Gradle build…

:config phase: createDefaultIncludeFiles
+found plugins: nativescript-geolocation
+found plugins: nativescript-https
+found plugins: nativescript-plugin-firebase
+found plugins: tns-core-modules-widgets

:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in C:\Users\jorge\projects\date.anytime\platforms\android/configurations folder…

:config phase: pluginExtend
+applying configuration from: C:\Users\jorge\projects\platforms\android\configurations\include.gradle
+applying configuration from: C:\Users\jorge\projects\platforms\android\configurations\nativescript-geolocation\include.gradle
+applying configuration from: C:\Users\jorge\projects\platforms\android\configurations\nativescript-https\include.gradle
+applying configuration from: C:\Users\jorge\projects\platforms\android\configurations\nativescript-plugin-firebase\include.gradle
+applying configuration from: C:\Users\jorge\projects\platforms\android\configurations\tns-core-modules-widgets\include.gradle

FAILURE: Build failed with an exception.
Build file ‘C:\Users\jorge\projects\platforms\android\build.gradle’ line: 765

  • What went wrong:
    A problem occurred evaluating root project ‘android’.

Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Command gradlew.bat failed with exit code 1

MY USER CONFIGURATION

C:\Users\jorge\projects\node_modules>VER

Microsoft Windows [Versión 10.0.15063]

C:\Users\jorge\projects\node_modules>tns info
All NativeScript components versions information

  • nativescript Up to date (3.2.1 )
  • tns-core-modules Up to date (3.2.0 )
  • tns-android Up to date (3.2.0 )
  • tns-ios Not installed

C:\Users\jorge\projects\node_modules>echo %ANDROID_HOME%
C:\Android\android-sdk

C:\Users\jorge\projects\node_modules>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_144

C:\Users\jorge\projects\date.anytime\node_modules>echo %PATH%
C:\Users\jorge\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Python\Python27;C:\Python\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Bitvise SSH Client;C:\Program Files\PuTTY;C:\Users\jorge\AppData\Local\Microsoft\WindowsApps;C:\adb;C:\Program Files\BRLCAD 7.26.0\bin;C:\Program Files (x86)\Elmer 8.3-c30fff2\bin;C:\Program Files (x86)\LLVM\bin;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Users\jorge\AppData\Local\Microsoft\WindowsApps;C:\Users\jorge\AppData\Roaming\npm

PROJECT DIR
Directorio de C:\Users\jorge\projects

<>DIR> .
<>DIR> …
.firebaserc
<>DIR> .git
<>DIR> .idea
<>DIR> .tmp_backup
<>DIR> app
firebase.json
firebase.nativescript.json
<>DIR> hooks
karma.conf.js
<>DIR> node_modules
package.json
<>DIR> platforms
5 archivos 3 135 bytes
9 dirs 291 957 465 088 bytes libres

APP DIR
Directorio de C:\Users\projects\jorge\app

<>DIR> .
<>DIR> …
app.css
app.js
<>DIR> App_Resources
db structure.txt
firebase db structure v0.2
firebase db structure.json
<>DIR> images
package.json
platform.android.css
platform.ios.css
README
<>DIR> shared
short db structure.txt
<>DIR> tests
<>DIR> views
10 archivos 9 051 bytes
7 dirs 291 957 403 648 bytes libres

NODE MODULE DIR

Directorio de C:\Users\jorge\projects\node_modules

<>DIR> .
<>DIR> …
<>DIR> .bin
<>DIR> accepts
<>DIR> adm-zip
<>DIR> after
<>DIR> ajv
<>DIR> ansi-regex
<>DIR> ansi-styles
<>DIR> any-promise
<>DIR> anymatch
<>DIR> arr-diff
<>DIR> arr-flatten
<>DIR> array-slice
<>DIR> array-unique
<>DIR> arraybuffer.slice
<>DIR> asn1
<>DIR> assert-plus
<>DIR> async
<>DIR> async-each
<>DIR> asynckit
<>DIR> aws-sign2
<>DIR> aws4
<>DIR> babel-code-frame
<>DIR> babel-messages
<>DIR> babel-runtime
<>DIR> babel-traverse
<>DIR> babel-types
<>DIR> babylon
<>DIR> backo2
<>DIR> balanced-match
<>DIR> base64-arraybuffer
<>DIR> base64-js
<>DIR> base64id
<>DIR> bcrypt-pbkdf
<>DIR> better-assert
<>DIR> big-integer
<>DIR> binary-extensions
<>DIR> blob
<>DIR> bluebird
<>DIR> body-parser
<>DIR> boom
<>DIR> bplist-creator
<>DIR> bplist-parser
<>DIR> brace-expansion
<>DIR> braces
<>DIR> bytes
<>DIR> callsite
<>DIR> caseless
<>DIR> chalk
<>DIR> chokidar
<>DIR> co
<>DIR> colors
<>DIR> combine-lists
<>DIR> combined-stream
<>DIR> component-bind
<>DIR> component-emitter
<>DIR> component-inherit
<>DIR> concat-map
<>DIR> connect
<>DIR> content-type
<>DIR> cookie
<>DIR> core-js
<>DIR> core-util-is
<>DIR> cryptiles
<>DIR> custom-event
<>DIR> dashdash
<>DIR> debug
<>DIR> delayed-stream
<>DIR> depd
<>DIR> di
<>DIR> dom-serialize
<>DIR> ecc-jsbn
<>DIR> ee-first
<>DIR> encodeurl
<>DIR> engine . io
<>DIR> engine.io-client
<>DIR> engine.io-parser
<>DIR> ent
<>DIR> escape-html
<>DIR> escape-string-regexp
<>DIR> esutils
<>DIR> eventemitter3
<>DIR> expand-braces
<>DIR> expand-brackets
<>DIR> expand-range
<>DIR> extend
<>DIR> extglob
<>DIR> extsprintf
<>DIR> fast-deep-equal
<>DIR> filename-regex
<>DIR> fill-range
<>DIR> finalhandler
<>DIR> for-in
<>DIR> for-own
<>DIR> forever-agent
<>DIR> form-data
<>DIR> fs-extra
<>DIR> fs-promise
<>DIR> fs.realpath
<>DIR> getpass
<>DIR> glob
<>DIR> glob-base
<>DIR> glob-parent
<>DIR> globals
<>DIR> graceful-fs
<>DIR> har-schema
<>DIR> har-validator
<>DIR> has-ansi
<>DIR> has-binary
<>DIR> has-cors
<>DIR> hawk
<>DIR> hoek
<>DIR> http-errors
<>DIR> http-proxy
<>DIR> http-signature
<>DIR> iconv-lite
<>DIR> indexof
<>DIR> inflight
<>DIR> inherits
<>DIR> invariant
<>DIR> is-binary-path
<>DIR> is-buffer
<>DIR> is-dotfile
<>DIR> is-equal-shallow
<>DIR> is-extendable
<>DIR> is-extglob
<>DIR> is-glob
<>DIR> is-number
<>DIR> is-posix-bracket
<>DIR> is-primitive
<>DIR> is-typedarray
<>DIR> isarray
<>DIR> isbinaryfile
<>DIR> isobject
<>DIR> isstream
<>DIR> jasmine-core
<>DIR> js-tokens
<>DIR> jsbn
<>DIR> json-schema
<>DIR> json-schema-traverse
<>DIR> json-stable-stringify
<>DIR> json-stringify-safe
<>DIR> json3
<>DIR> jsonfile
<>DIR> jsonify
<>DIR> jsprim
<>DIR> karma
<>DIR> karma-jasmine
<>DIR> karma-nativescript-launcher
<>DIR> kind-of
<>DIR> lazy
<>DIR> lodash
<>DIR> log4js
<>DIR> loose-envify
<>DIR> lru-cache
<>DIR> media-typer
<>DIR> micromatch
<>DIR> mime
<>DIR> mime-db
<>DIR> mime-types
<>DIR> minimatch
<>DIR> minimist
<>DIR> mkdirp
<>DIR> ms
<>DIR> mute-stream
<>DIR> mz
<>DIR> nativescript-chatview
<>DIR> nativescript-dev-android-snapshot
<>DIR> nativescript-dom
<>DIR> nativescript-geolocation
<>DIR> nativescript-hook
<>DIR> nativescript-https
<>DIR> nativescript-plugin-firebase
<>DIR> nativescript-slides
<>DIR> nativescript-theme-core
<>DIR> nativescript-unit-test-runner
<>DIR> negotiator
<>DIR> normalize-path
<>DIR> oauth-sign
<>DIR> object-assign
<>DIR> object-component
<>DIR> object.omit
<>DIR> on-finished
<>DIR> once
<>DIR> optimist
<>DIR> options
<>DIR> os-tmpdir
<>DIR> parse-glob
<>DIR> parsejson
<>DIR> parseqs
<>DIR> parseuri
<>DIR> parseurl
<>DIR> path-is-absolute
<>DIR> pegjs
<>DIR> performance-now
<>DIR> plist
<>DIR> preserve
<>DIR> process-nextick-args
<>DIR> prompt-lite
<>DIR> punycode
<>DIR> qjobs
<>DIR> qs
<>DIR> randomatic
<>DIR> range-parser
<>DIR> raw-body
<>DIR> read
<>DIR> readable-stream
<>DIR> readdirp
<>DIR> regenerator-runtime
<>DIR> regex-cache
<>DIR> remove-trailing-separator
<>DIR> repeat-element
<>DIR> repeat-string
<>DIR> request
<>DIR> request-promise
<>DIR> request-promise-core
<>DIR> requires-port
<>DIR> revalidator
<>DIR> rimraf
<>DIR> safe-buffer
<>DIR> semver
<>DIR> set-immediate-shim
<>DIR> setprototypeof
<>DIR> shelljs
<>DIR> simple-plist
<>DIR> sntp
<>DIR> socket . io
<>DIR> socket.io-adapter
<>DIR> socket.io-client
<>DIR> socket.io-parser
<>DIR> source-map
<>DIR> sshpk
<>DIR> statuses
<>DIR> stealthy-require
<>DIR> stream-buffers
<>DIR> stringstream
<>DIR> string_decoder
<>DIR> strip-ansi
<>DIR> supports-color
<>DIR> thenify
<>DIR> thenify-all
<>DIR> tmp
<>DIR> tns-android
<>DIR> tns-core-modules
<>DIR> tns-core-modules-widgets
<>DIR> to-array
<>DIR> to-fast-properties
<>DIR> tough-cookie
<>DIR> tunnel-agent
<>DIR> tweetnacl
<>DIR> type-is
<>DIR> ultron
<>DIR> unpipe
<>DIR> useragent
<>DIR> util-deprecate
<>DIR> utils-merge
<>DIR> uuid
<>DIR> verror
<>DIR> void-elements
<>DIR> wordwrap
<>DIR> wrappy
<>DIR> ws
<>DIR> wtf-8
<>DIR> xcode
<>DIR> xmlbuilder
<>DIR> xmldom
<>DIR> xmlhttprequest-ssl
<>DIR> yeast
0 archivos 0 bytes
269 dirs 291 957 288 960 bytes libres


#2

Try cleaning your gradle cache located in the user directory/.gradle.


#3

ok, I delete the caches dir in .gradle, I have the same result

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\jorge.WINDOWS-VP1N6L2\projects\date.anytime\platforms\android\build.gradle’ line: 765

  • What went wrong:
    A problem occurred evaluating root project ‘android’.

Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().


#4

running the command “gradlew build --stacktrace”

I receive this

  • Exception is:
    org.gradle.api.GradleScriptException: A problem occurred evaluating root project ‘android’.


    .
    Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().


    .
    Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().


    .
    Caused by: org.gradle.api.UncheckedIOException: java.io.IOException: Acceso denegado


    .
    Caused by: java.io.IOException: Acceso denegado

‘Acceso denegado’ means ‘Access denied’


#5

Does gradle have write and execute access to the date.anytime directory? What happens when you run the shell/cmd as admin and run the same command?


#6

sorry, the first time the .gradle dir was not deleted, the cmd del command dont confirm the action. Now i confirmed that the .gradle dir was deleted and run again the build command, in admin cmd windows, that is the message

spawn gradlew.bat ENOENT

the complete message was
tns build android
Executing before-prepare hook from C:\Users\jorge.WINDOWS-VP1N6L2\projects\date.anytime\hooks\before-prepare\nativescript-dev-android-snapshot.js
Executing before-prepare hook from C:\Users\jorge.WINDOWS-VP1N6L2\projects\date.anytime\hooks\before-prepare\nativescript-plugin-firebase.js
Preparing project…
Successfully prepared plugin nativescript-chatview for android.
Successfully prepared plugin nativescript-dom for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-https for android.
Successfully prepared plugin nativescript-plugin-firebase for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-unit-test-runner for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Gradle build…
spawn gradlew.bat ENOENT




#7

is for a incomplete delete of platform/android

sorry for that

i ran the command in my second user, as administrator

Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

FAILURE: Build failed with an exception.

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

Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Command gradlew.bat failed with exit code 1

#8

See, you are past the original blocker. Now you need to figure out what is causing the resources merging failure! Run with --log trace, or ideally ./gradlew assembleDebug --stacktrace inside the platforms/android dir


#9

The resources merging failure is for a image in \app\App_Resources\Android\drawable-nodpi(is the second time i found that, with this same project)

The ’Access denied’ i solved using a secondary user, the primary can’t do change to android platform with commands “tns platform remove android” + tns platform add android or tns platform update android

I think this post can be close, (i have new issue, but i think i can solve).