Can't build gradle project

android

#1

Hi,
I’ve followed all the steps on NativeScript Installation instructions and all went well.

When i run tns run doctor, it returns me that no issues were detected:

Your ANDROID_HOME environment variable is set and points to correct directory.
Your adb from the Android SDK is correctly installed.
The Android SDK is installed.
A compatible Android SDK for compilation is found.
Javac is installed and is configured properly.
The Java Development Kit (JDK) is installed and is configured properly.
Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
Component nativescript has 4.2.0 version and is up to date.
Component tns-core-modules has 4.2.0 version and is up to date.
Component tns-android has 4.2.0 version and is up to date.
Component tns-ios has 4.2.0 version and is up to date.

Then i started a new blank project –template tns-template-blank-ng.

The problem is when i`m gonna run my project with tns run android, it returns me this:

$ tns run android
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices…
Executing before-liveSync hook from D:\Programacao\GoYeahFront\hooks\before-liveSync\nativescript-angular-sync.js
Executing before-watchPatterns hook from D:\Programacao\GoYeahFront\hooks\before-watchPatterns\nativescript-dev-typescript.js
Executing before-watchPatterns hook from D:\Programacao\GoYeahFront\hooks\before-watchPatterns\nativescript-dev-webpack.js
Executing before-watch hook from D:\Programacao\GoYeahFront\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.7.2
Executing before-watch hook from D:\Programacao\GoYeahFront\hooks\before-watch\nativescript-dev-webpack.js
Executing before-shouldPrepare hook from D:\Programacao\GoYeahFront\hooks\before-shouldPrepare\nativescript-dev-webpack.js
Skipping prepare.
Building project…
Gradle build…
+ setting applicationId
+ applying user-defined configuration from D:\Programacao\GoYeahFront\app\App_Resources\Android\app.gradle
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: D:\Programacao\GoYeahFront\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

FAILURE: Build failed with an exception.

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

Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

  • 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 4s
Unable to apply changes on device: G9AZB601B737YT7. Error is: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from D:\Programacao\GoYeahFront\hooks\after-watch\nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from D:\Programacao\GoYeahFront\hooks\after-watch\nativescript-dev-webpack.js
Executing after-watch hook from D:\Programacao\GoYeahFront\hooks\after-watch\nativescript-dev-typescript.js
Executing after-watch hook from D:\Programacao\GoYeahFront\hooks\after-watch\nativescript-dev-webpack.js

Any help will be appreciated,
Thanks!