Android Studio - 如何使用库(从eclipse项目) [英] Android Studio - how to use libraries (from eclipse projects)

查看:223
本文介绍了Android Studio - 如何使用库(从eclipse项目)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是。每个人都在测试Android Studio。我在项目中使用Eclipse,我想迁移到Android Studio。我的项目有问题。

Yes. Everybody are testing Android Studio. I'm using Eclipse in my projects and I want to migrate to Android Studio. I'm having problems with my projects.

我读过这个页面: http://developer.android.com/sdk/installing/migrate.html

不是一个很好的我的意见。

Not a great how to in my opinion.

我正在我的项目库中使用不是.jar格式,但它们是eclipse项目(在属性中选中是库)。

I'm using in my project libraries that are not in .jar formats but they're eclipse projects (with checked "is library" in properties).

你能告诉我如何将我的项目移到Android Studio?我遇到了很多错误。我也在使用Google Play服务,Android Studio向我展示了相同API的旧版本。

Could you tell me how to move my projects to Android Studio? I'm having problems and tons of errors. I'm also using Google Play Services and Android Studio showed me old versions of the same API's.

如何添加例如ActionBarSherlock或Android-ViewPagerIndicator?

How to add for example ActionBarSherlock or Android-ViewPagerIndicator?

Shoud我导入就像在eclipse中所有这些项目。但在Android Studio中,我不能将项目标记为库?

Shoud I import just like in eclipse all of these projects. But in Android Studio I can't mark project as library or not?

推荐答案

这对我有用。

build.gradle 文件:

dependencies {
    compile files('libs/android-support-v4.jar')
    compile project(':MyLibrary')
}

而在IntelliJ模块文件中,HelloWorld.iml:

And, in the IntelliJ Module file, HelloWorld.iml:

<orderEntry type="library" name="android-support-v4" level="application" />
<orderEntry type="library" name="MyLibrary.aar" level="project" />

在图书馆项目中,没有太多事情要做:告诉Gradle和Android Studio这是一个Android图书馆,应用插件:'android-library'选项名称=LIBRARY_PROJECTvalue =true

In the library project, there’s not much to do: tell Gradle and Android Studio that this is an Android library, with apply plugin: ‘android-library’ and option name="LIBRARY_PROJECT" value="true" , respectively.

这篇关于Android Studio - 如何使用库(从eclipse项目)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆