sample-Groceries \ platforms \ android \ gradlew.bat失败,退出代码为

时间:2016-07-03 07:33:29

标签: android angular nativescript

尝试使用Dell Inspiron在NativeScript.org上关注适用于Android的示例杂货应用程序的教程

OS: Windows 10 Home
Processor: AMD A8-7410 APU with AMD Radeon R5 Graphics 2.20 GHz
Installed memory (RAM): 8.00 GB (6.94 GB usable)
System type: 64-bit Operating System, x64-based processor

根据此处显示的步骤1.4 http://docs.nativescript.org/angular/tutorial/ng-chapter-1#11-install-nativescript-and-configure-your-environment执行以下命令后出现以下错误:

tns run android --emulator

以下是例外:

        Exception in thread "main" java.lang.IllegalArgumentException: Class android.support.graphics.drawable.AnimatedVectorDrawableCompat$AnimatedVectorDrawableCompatState conflict: C:\_Sandbox\NativeScript\sample-Groceries\platforms\android\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\23.4.0\jars\classes.jar and C:\_Sandbox\NativeScript\sample-Groceries\platforms\android\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\23.3.0\jars\classes.jar
            at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21)
            at com.telerik.metadata.Builder.build(Builder.java:39)
            at com.telerik.metadata.Generator.main(Generator.java:44)
    :buildMetadata FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':buildMetadata'.
    > Process 'command 'C:\Program Files\Java\jdk1.8.0_92\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: 1 mins 19.102 secs
    Command C:\_Sandbox\NativeScript\sample-Groceries\platforms\android\gradlew.bat failed with exit code 1
    # run android

我还在下面列出了日志文件:

(文件太大,这里是链接)

Error(s) Log File

2 个答案:

答案 0 :(得分:1)

我有同样的问题。为了解决这个问题,我安装了Android 6.0(API 23)。

所以..转到cmd提示符(Windows),输入'android'。它打开了Android SDK Manager。找到Android 6.0并安装它。

之后,'tns platform add android'命令工作。

希望这有帮助!

答案 1 :(得分:0)

这似乎是您正在使用的“Android支持存储库”版本的问题。运行Android SDK Manager,确保选中“Android Support Repository”,单击“Install”,然后重试。

您可以通过在命令行或终端上键入android来访问Android SDK Manager。