![](/img/trans.png)
[英]Issue adding jar file in Android project in Android studio
[英]Error adding a JAR file to Android Studio project
我正在嘗試將此 jar文件添加到我的Android Studio項目中:
我做了必要的步驟,將罐子添加為“庫”。 但是構建給我以下錯誤:
Error:error reading C:\Users\Malik\AndroidStudioProjects\test6\app\libs\imageviewtouch.jar; error in opening zip file
tion timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>
我嘗試添加從其他地方下載的另一個jar文件,但沒有給出錯誤。
這個jar文件是否已損壞,或者我缺少依賴項?
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.greenbergc.test6"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile files('libs/about-0.2.1.jar')
compile files('libs/imageviewtouch.jar')
}
我嘗試添加此jar文件並成功添加,沒有任何錯誤。 我不知道您如何添加此文件。 這是我用來添加此jar文件的過程:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.