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

查看:23
本文介绍了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 项目(在属性中选中了is library").

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?

我应该像在 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'option name="LIBRARY_PROJECT" value="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天全站免登陆