Nativescript: Could not generate a proxy class for BuildArtifactReportTask

Created on 14 Jul 2018  路  3Comments  路  Source: NativeScript/NativeScript

I have generated a new project with the following command
tns create nativescript --template tns-template-blank

I have added no code to the project.
When I try to run it on Android, build fails with the following error:

Building project...
Gradle build...
         + setting applicationId
         + applying user-defined configuration from D:\Taf\Moventes\Dev\moventest\nativescript\app\App_Resources\Android\app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: D:\Taf\Moventes\Dev\moventest\nativescript\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not generate a proxy class for class com.android.build.gradle.tasks.BuildArtifactReportTask.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
Unable to apply changes on device: FA75Z1802706. Error is: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from d:\Taf\Moventes\Dev\moventest\nativescript\hooks\after-watch\nativescript-dev-webpack.js
Executing after-watch hook from d:\Taf\Moventes\Dev\moventest\nativescript\hooks\after-watch\nativescript-dev-webpack.js

I am on Windows 10, using the following:

  • tns: version 4.1.2
  • tns-core-modules: version 4.1.0
  • tns-android: version 4.1.3
needs more info template

Most helpful comment

For those having the same problem, I had to update my JDK version to 1.8.0_181, delete the .gradle directory in my users' home and launch build again.
Then it worked ^^
Thanks for the help!

All 3 comments

@Malrok I am able to successfully create a project using the base JS template - tested on Windows 10.

From the error log, it seems that the issue is related to a corrputed Gradle - check this thread for possible solutions

For those having the same problem, I had to update my JDK version to 1.8.0_181, delete the .gradle directory in my users' home and launch build again.
Then it worked ^^
Thanks for the help!

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