1. 程式人生 > >Error:Execution failed for task ':app:compileDebugNdk' 解決方法

Error:Execution failed for task ':app:compileDebugNdk' 解決方法

近期在看webrtc原始碼的時候出現了Error:Execution failed for task ':app:compileDebugNdk'.的問題,具體描述如下:

Error:Execution failed for task ':app:compileDebugNdk'.

 > Error: NDK integration is deprecated in the current plugin.  Consider trying the new experimental plugin.  For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. 

這個問題是由於NDK引起的,我的IDEA中是沒有整合NDK外掛的,所以出現了這個問題。其實這個問題並不難解決,以下我將貼出我的解決方案,我的studio版本是1.4的,其他版本也可做參考哈。

1.首先,將專案切換到android分類,右鍵專案新建一個jni資料夾

2.在將專案切換到project分類,在主工程中找到jni資料夾,右擊reveal in Finder進入資料夾


3.開啟資料夾後,在裡面新建一個空的.c檔案


4.回到IDEA中,在build.gradle中加入以下語句

sourceSets.main {
    jniLibs.srcDir 'libs'
    jni.srcDirs = []
}

5.再重新編譯專案就沒有問題了。。

相關推薦

Error:Execution failed for task ':app:compileDebugNdk' 解決方法

近期在看webrtc原始碼的時候出現了Error:Execution failed for task ':app:compileDebugNdk'.的問題,具體描述如下: Error:Execution failed for task ':app:compileDebugN

Android Error:Execution failed for task ':app:compileDebugJavaWithJavac' 解決方案

最近Android專案開發中碰到一個異常,折騰了許久才找到問題的根源。 Google、百度搜索前兩頁內容瀏覽了一遍,總結了幾種方案: 1、升級更新buildToolsVersion 到最新版本 2、升級Android Studio 2.2.2版本,JDK 1.8版本 3、

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.解決方案

今天匯入工程build的時候發生了一個錯誤; Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Coul

Error:Execution failed for task :app:transformClassesWithInstantRunForDebug解決方案

最近更新過Android Studio後,很多新匯入的工程會報錯,究其書面意思就是通過InstantRun無法轉換classes。 報錯資訊: Error:Execution failed for

安卓中執行報錯Error:Execution failed for task ':app:transformClassesWithDexForDebug'解決

錯誤如下:Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.> java.la

Error:Execution failed for task ':app:transformClassesWithDexForDebug'解決記錄

3個錯誤non-zero exit value 1; non-zero exit value 2; non-zero exit value 3 Error:Execution failed

關於android studio 出現Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解決辦法

前段時間開啟Android studio 在build過程中總會出現以下錯誤 Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’. Conflict with dependency ‘

快速解決Error:Execution failed for task ':app:compileReleaseJavaWithJavac'. > Compilation failed; see th

前言 CSDN部落格地址 (由於csdn的圖片經常出現不顯示問題,以後就在簡書寫部落格了) GitHub由於近期較忙,正加急整理中,敬請期待… 開發中遇到的問題 自從AS

Error:Execution failed for task ':app:clean'. > Unable to delete directory: 最新解決方法

最近在一個新的專案BUILD過程中遇到了這個問題 Error:Execution failed for task ‘:app:clean’. Unable to delete directory:** 我的studio是2.3.3 之前我也遇

Error:Execution failed for task ':app:clean'. > Unable to delete directory 終極解決方案

<span style="font-size:12px;">Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSource

Error:Execution failed for task :app:transformJackWithJackForDebug - Android

Remove jackOption from defaultConfig in build.gradle Add following lines in Application gradle dependencies { classpath 'com.android.tools.build:

Error:Execution failed for task ‘:app:clean’.

Error:Execution failed for task ‘:app:clean’. Unable to delete directory: E:\Only\android\StudioWorkPlace\YinJian\app\build\intermediates

Android Error:Execution failed for task ':app:compileDebugJavaWithJavac'

這個錯誤是很模糊,根本無法定位錯誤低點,這時就需要獲得詳細的錯誤日誌來推斷錯誤 首先,可以開啟黑視窗(CMD)定位到專案目錄,或者是直接用as,開啟下面的Terminal,效果跟黑視窗一樣,而且不用手動定位到目錄 然後輸入命令 gradlew compileDebu

AS:Error:Execution failed for task ':app:preDebugAndroidTestBuild'.

在新建AS專案時,由於gradle的版本衝突原因,經常會出現如下的錯誤 Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency

Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.and

                               使用環境:        剛剛為了一個新的功能,打算做個demo試試,結果剛建立了一個功能就這樣了。 Error:Execution failed for task ':app:preDebugAndro

Android 開發過程中遇到的問題Error:Execution failed for task ':app:processDebugManifest'

在開發過程中遇到了這樣一個問題: 問題1: Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed with multiple errors, see l

關於 Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.P

原 關於 Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.P

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.tran

報錯: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.tran 包此型別的錯,大多是資原始檔引用的衝突,看後面具體的衝突原

【Android】AndroidStudio打包apk出現的一些問題 `Error:Execution failed for task ':app:lintVitalRelease'.

1,錯誤程式碼: `Error:Execution failed for task ‘:app:lintVitalRelease’. Lint found fatal errors whi

android 錯誤Error:Execution failed for task ':app:lintVitalRelease'.>

Error:Execution failed for task ':app:lintVitalRelease'.> Lint found fatal errors while assemblin