Home » Android » NativeScript – Error building project

NativeScript – Error building project

Posted by: admin November 1, 2017 Leave a comment

Questions:

Well, I just installed the plugin nativescript-geolocation and nativescript-google-maps-sdk but it said that I needed to update my Google Play Services.

So I just needed to add this to my app.gradle:

project.ext {
    googlePlayServicesVersion = "11.2.+"
  }

So I did.

And I also updated my Google Repository on Android Studio.

And when I’m running:
tns run android

I get this error:

C:\Sistema-3E-Front-end>tns run android
Searching for devices...
Executing before-liveSync hook from C:\Sistema-3E-Front-end\hooks\before-liveSync\nativescript-angular-sync.js
Executing before-prepare hook from C:\Sistema-3E-Front-end\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
Preparing project...
Project successfully prepared (Android)
Building project...
Gradle build...

 :config phase:  createDefaultIncludeFiles
        +found plugins: nativescript-background-http
        +found plugins: nativescript-geolocation
        +found plugins: nativescript-google-maps-sdk
        +found plugins: nativescript-imagepicker
        +found plugins: nativescript-pro-ui
        +found plugins: tns-core-modules-widgets

:config phase:  createPluginsConfigFile
         Creating product flavors include.gradle file in C:\Sistema-3E-Front-end\platforms\android/configurations folder...

:config phase:  pluginExtend
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\include.gradle
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\nativescript-background-http\include.gradle
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\nativescript-geolocation\include.gradle
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\nativescript-google-maps-sdk\include.gradle
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\nativescript-imagepicker\include.gradle
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\nativescript-pro-ui\include.gradle
        +applying configuration from: C:\Sistema-3E-Front-end\platforms\android\configurations\tns-core-modules-widgets\include.gradle

 :config phase:  addAarDependencies
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Chart-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Common-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Data-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Feedback-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Gauges-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Input-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\List-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\Primitives-2017.1.1003-dev-release.aar
        +adding dependency: C:\Sistema-3E-Front-end\platforms\android\libs\aar\widgets-release.aar
Running full build
finished with reading lines with js files
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Exception in thread "main" java.lang.IllegalArgumentException: Class com.google.android.gms.common.internal.zzae conflict: C:\Sistema-3E-Front-end\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base.2.2\jars\classes.jar and C:\Sistema-3E-Front-end\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base.0.0\jars\classes.jar
        at com.telerik.metadata.ClassRepo.addToCache(ClassRepo.java:21)
        at com.telerik.metadata.Builder.build(Builder.java:38)
        at com.telerik.metadata.Generator.main(Generator.java:44)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildMetadata'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_91\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.
Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from C:\Sistema-3E-Front-end\hooks\after-watch\nativescript-dev-typescript.js
Answers: