2017-10-29 202 views
1

我想運行我的項目,但無法運行。 這裏是「事件日誌」。執行任務時出現「Gradle build with 188 error(s)」依賴關係

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

截圖: enter image description here

,這裏是我的build.gradle(應用程序)。

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:[email protected] 
| +--- io.realm:realm-annotations:[email protected] 
| \--- com.getkeepsafe.relinker:relinker:[email protected] 
+--- io.realm:realm-annotations:[email protected] 
+--- com.android.support:appcompat-v7:[email protected] 
| +--- com.android.support:support-v4:[email protected] 
| | +--- com.android.support:support-compat:[email protected] 
| | | \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-media-compat:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-core-utils:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support- 
... 

BUILD SUCCESSFUL 

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

感謝您提前幫助。

回答

1

此問題已解決。我已經刪除了我的項目並從git倉庫下載我的項目。那麼上面提到的錯誤不會發生。

+0

謝謝!執行'git reset --hard HEAD && git clean'後,我爲我做了改變。如果沒有你,不會嘗試 – lucidbrot