![](/img/trans.png)
[英]Android Studio 'Add as Library' missing For Universal Tween Engine on Libgdx
[英]Android Studio: Add as Library option missing
我已經開始使用Android Studio並遇到了問題。 我似乎沒有弄清楚為什么在我的項目中添加庫時看不到Add as Library選項。
我為了添加庫而執行的步驟:
*在app存儲庫中的libs文件夾中添加庫。
*右鍵單擊以查看“ 添加為庫”選項。 (看不到!)
*由於上面的步驟不起作用,我想到將庫直接添加到libs文件夾中,即在Explorer中。 失敗!
因此,我無法繼續我的項目。
PS:我已經刪除了Eclipse,我不想安裝再次進行設置。
build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.team1cloud.cloudapp"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.apis:google-api-services-drive:v2-rev161-1.19.1'
compile files('libs/commons-logging-1.1.1.jar')
compile files('libs/google-api-client-1.18.0-rc.jar')
compile files('libs/google-api-client-android-1.18.0-rc.jar')
compile files('libs/google-api-client-appengine-1.18.0-rc.jar')
compile files('libs/google-api-client-gson-1.18.0-rc.jar')
compile files('libs/google-api-client-jackson2-1.18.0-rc.jar')
compile files('libs/google-api-client-java6-1.18.0-rc.jar')
compile files('libs/google-api-client-protobuf-1.18.0-rc.jar')
compile files('libs/google-api-client-servlet-1.18.0-rc.jar')
compile files('libs/google-api-client-xml-1.18.0-rc.jar')
compile files('libs/google-http-client-1.18.0-rc.jar')
compile files('libs/google-http-client-android-1.18.0-rc.jar')
compile files('libs/google-http-client-appengine-1.18.0-rc.jar')
compile files('libs/google-oauth-client-java6-1.18.0-rc.jar')
compile files('libs/google-oauth-client-jetty-1.18.0-rc.jar')
compile files('libs/google-oauth-client-servlet-1.18.0-rc.jar')
compile files('libs/google-play-services.jar')
compile files('libs/gson-2.1.jar')
compile files('libs/httpclient-4.0.1.jar')
compile files('libs/httpcore-4.0.1.jar')
compile files('libs/jackson-core-2.1.3.jar')
compile files('libs/jackson-core-asl-1.9.11.jar')
compile files('libs/jdo2-api-2.3-eb.jar')
compile files('libs/jetty-6.1.26.jar')
compile files('libs/jetty-util-6.1.26.jar')
compile files('C:/Users/sjeet/AndroidStudioProjects/CloudApp/gradle/wrapper/gradle-wrapper.jar')
}
謝謝。 請幫忙!!!
Android Studio是基於gradle的。 如果您有一個jar文件作為項目的依賴項,請打開build.gradle
文件並添加依賴項的部分
compile files('libs/name_file.jar')
如果您將庫的源代碼作為依賴項導入,則可以使用
compile project(':NameProject')
編譯它。
你應該可以通過UI做同樣的事情。
右鍵單擊您的項目,然后單擊“ Open Module Settings
,然后單擊“ Dependencies
選項卡。 從那里,您可以添加jar或庫項目作為主項目的依賴項
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.