" Gradle构建完成188个错误"在执行任务android依赖项

时间:2017-10-29 02:14:59

标签: android android-gradle

我想运行我的项目,但无法运行。 这是"事件日志"。

10:47   Executing tasks: [androidDependencies]
10:47   Gradle build finished with 188 error(s) in 5s 822ms

截图: enter image description here

这是我的build.gradle(app)。

apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    compileSdkVersion 24
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "org.macho.beforeandafter"
        minSdkVersion 21
        targetSdkVersion 24
        versionCode 5
        versionName "1.4"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'io.realm:android-adapters:1.2.1'
    testCompile 'junit:junit:4.12'
}

我可以清理项目并构建项目,但不能运行项目。 另外,我可以执行任务" androidDependencies"在命令行上。 这是结果。

Yuuki-no-MacBook-Air:BeforeAndAfter yukim$ ./gradlew androidDependencies
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Users/yukim/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

:app:androidDependencies
debug
+--- io.realm:realm-android-library:1.1.0@aar
|    +--- io.realm:realm-annotations:1.1.0@jar
|    \--- com.getkeepsafe.relinker:relinker:1.2.1@aar
+--- io.realm:realm-annotations:1.1.0@jar
+--- com.android.support:appcompat-v7:24.2.1@aar
|    +--- com.android.support:support-v4:24.2.1@aar
|    |    +--- com.android.support:support-compat:24.2.1@aar
|    |    |    \--- com.android.support:support-annotations:24.2.1@jar
|    |    +--- com.android.support:support-media-compat:24.2.1@aar
|    |    |    \--- com.android.support:support-compat:24.2.1@aar
|    |    |         \--- com.android.support:support-annotations:24.2.1@jar
|    |    +--- com.android.support:support-core-utils:24.2.1@aar
|    |    |    \--- com.android.support:support-compat:24.2.1@aar
|    |    |         \--- com.android.support:support-
...

BUILD SUCCESSFUL

Total time: 15.079 secs
Yuuki-no-MacBook-Air:BeforeAndAfter yukim$ 

提前感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

此问题已得到解决。我删除了我的项目并从git repository下载了我的项目。然后我上面提到的错误没有发生。