简体   繁体   English

Gradle无法使用Parse构建应用

[英]Gradle unable to build app with Parse

Hello everyone i am new to parse and i am trying to connect my android app to parse but it is showing error below 大家好,我是新来解析的人,我正在尝试连接我的Android应用程序进行解析,但是下面显示了错误

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 错误:任务':app:transformClassesWithDexForDebug'的执行失败。

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_25\\bin\\java.exe'' finished with non-zero exit value 2 com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'C:\\ Program Files \\ Java \\ jdk1.7.0_25 \\ bin \\ java.exe''的退出值非零2

my gradle file is shown below: 我的gradle文件如下所示:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.thakur.space"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.parse.bolts:bolts-android:1.3.0'
    compile 'com.parse:parse-android:1.11.0'
}

plz help me on this how to fix this.. 请帮助我解决此问题。

Whats your logcat throws 你的logcat抛出了什么

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 错误:任务':app:transformClassesWithDexForDebug'的执行失败。

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_25\\bin\\java.exe'' finished with non-zero exit value 2 com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'C:\\ Program Files \\ Java \\ jdk1.7.0_25 \\ bin \\ java.exe''的退出值非零2

The Android plugin for Gradle available in Android SDK Build Tools 21.1 and higher supports multidex as part of your build configuration. Android SDK Build Tools 21.1和更高版本中提供的Gradle Android插件支持multidex作为构建配置的一部分。 Make sure you update the Android SDK Build Tools tools and the Android Support Repository to the latest version using the SDK Manager before attempting to configure your app for multidex. 在尝试为Multidex配置应用程序之前,请确保使用SDK Manager将Android SDK Build Tools工具和Android支持存储库更新到最新版本。

Setting up your app development project to use a multidex configuration requires that you make a few modifications to your app development project. 设置应用程序开发项目以使用multidex配置需要对应用程序开发项目进行一些修改。

In particular you need to perform the following steps: 特别是,您需要执行以下步骤:

  1. Change your Gradle build configuration to enable multidex 更改您的Gradle构建配置以启用Multidex
  2. Modify your manifest to reference the MultiDexApplication class 修改清单以引用MultiDexApplication类

Modify your app Gradle build file configuration to include the support library and enable multidex output . 修改您的应用Gradle构建文件配置,以包括支持库并启用multidex输出。

    android {
    compileSdkVersion 23
buildToolsVersion "23.0.2"

    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 23
        ...

        // Enabling multidex support.
        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
    // Add yours
}

Then clean and rebuild Your Project With Sync . 然后使用Sync清理并重建项目

Read

http://developer.android.com/intl/es/tools/building/multidex.html http://developer.android.com/intl/es/tools/building/multidex.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM