android - 错误 :Execution failed for task ':app:dexDebug' when importing ParseUI-widget and Login as modules

标签 android android-studio parse-platform module android-parsequeryadapter

我是 Parse 的新手,我在使用 ParseUI-Login 和 ParseUI-Widget 时遇到了一些问题。

在我的项目中将 ParseLoginUI 作为模块导入后,我单击运行应用程序按钮,然后发生了错误。

我和 Han ( Error:Execution failed for task ':app:dexDebug'. when importing ParseLoginUI as a module ) 有完全相同的问题,但是,他提供的解决方案对我不起作用..

我可能还会提到我不知道说明中的“克隆项目”是什么意思,我下载了 zip 并将模块从“我的下载”导入到 android studio。

下面是我的应用程序build.gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.joakim.parsetest"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], exclude: 'android-support-v4.jar',dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile project(':ParseUI-Login')
    compile project(':ParseUI-Widget')
}

下面是ParseUI-Login build.gradle

apply plugin: 'android-library'

dependencies {
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.parse:parse-android:1.10.1'

    provided 'com.facebook.android:facebook-android-sdk:4.0.1'
    provided files("$rootProject.projectDir/ParseUI-Login/libs/ParseFacebookUtilsV4-1.10.1.jar")
    provided files("$rootProject.projectDir/ParseUI-Login/libs/ParseTwitterUtils-1.10.1.jar")
}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 21
    }
}

下面是 ParseUI-widget build.gradle

apply plugin: 'com.android.library'

dependencies {
    compile 'com.parse:parse-android:1.10.1'

    androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
    androidTestCompile 'org.mockito:mockito-core:1.10.19'
    androidTestCompile 'org.skyscreamer:jsonassert:1.2.3'
}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 21
    }
}

最佳答案

在您的应用程序 build.gradle 中试试这个:

dependencies {
    compile fileTree(include: ['*.jar'], exclude: 'android-support-v4.jar',dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.parse.bolts:bolts-android:1.1.4'
    compile 'com.parse:parseui-login-android:0.0.1' 
}

我的应用程序的 ParseUI-Login 遇到了类似的问题,这对我有用。

关于android - 错误 :Execution failed for task ':app:dexDebug' when importing ParseUI-widget and Login as modules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33110928/

相关文章:

android - ADB over WiFi 连接在连接的 USB 上丢失

ios - 提交到 App Store 时出现解析问题

ios - 如何在异常处理程序中运行方法?

android - 过时的设备 : Parse Push Notification to Android devices

Android 通知 MediaStyle 忽略正在进行的标志

android - 为什么 "share-to"菜单项在 Android 4.0.3 PHONE HTC OneX 中不见了

android - 什么是 Facebook 和 Google + 类应用程序中使用的 Rage Shake api,我可以在我的应用程序中使用相同的 api 吗?

Android - 无法实例化一个或多个类

java - 在一个类中使用另一个类中的变量 NullpointerException - RunTimeException

android - 当我按下生成签名的 apk 时,我只得到 app-release-unaligned.apk