簡體   English   中英

系統找不到android studio中指定的文件?

[英]The system cannot find the file specified in android studio?

我正在嘗試在 Android Studio 2.0 中創建一個新的示例應用程序。 當我嘗試運行或調試時,它會顯示一個編譯時錯誤,例如,

任務“:app:compileDebugJavaWithJavac”執行失敗。

java.io.FileNotFoundException: D:\\Android Studio\\newapp\\app\\libs\\core.jar(系統找不到指定的文件)

我曾嘗試通過提供路徑 JAVA_HOME C:\\Program Files\\Java\\jdk1.7.0_45 和 Sync project with gradle。

這是我的搖籃

android { compileSdkVersion 23 buildToolsVersion "23.0.1" useLibrary 'org.apache.http.legacy' ... }

依賴{

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:23.0.1-alpha2'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.0.1'

compile 'org.apache.httpcomponents:httpclient:4.5'

compile 'com.google.android.gms:play-services:+'

compile 'org.apache.httpcomponents:httpclient:4.2.6'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile files('libs/core.jar')

}

即使在那之后我也找不到任何解決方案。

先感謝您

libs\\core.jar(系統找不到指定的文件)

對我來說似乎是一個明顯的錯誤......

刪除此行。 你不需要它

compile files('libs/core.jar')

可以core.jar文件添加到 libs 文件夾中,但您仍然不需要該行,因為您已經在編譯它

另外,請只選擇一個版本。 您不需要多次添加它們

compile 'com.android.support:appcompat-v7:23.0.1-alpha2'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.2.0'

對這些也一樣

compile 'com.android.support:design:23.2.0'
compile 'com.android.support:design:23.0.1'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM