添加Holoeverywhere Android Studio中项目 [英] Add Holoeverywhere to project in Android Studio

查看:300
本文介绍了添加Holoeverywhere Android Studio中项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在摇篮和Android工作室(IntelliJ IDEA的基于IDE)新。我的问题是纠正进口holoeverywhere项目。我看过很多类似的话题,但他们dign't给我的问题,我的解决办法。

I'm new in Gradle and Android Studio(Intellij Idea based IDE). My problem is to correct import holoeverywhere to project. I read many similar topics but they dign't give my solution on my problem.

类似的主题:

<一个href=\"http://stackoverflow.com/questions/16579367/android-studio-not-working-with-holoeverywhere-and-actionbarsherlock\">Android工作室与HoloEverywhere工作,ActionBarSherlock

<一个href=\"http://stackoverflow.com/questions/16987512/building-android-studio-project-with-holoeverywhere-fails\">Building与Android的HoloEverywhere Studio项目失败

<一个href=\"http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio\">How做我添加一个库项目到Android工作室?

我下面的操作方法看跌屏幕:

Below put screens of my method of operation:

1首先从头开始创建新的项目

1 First create new project from scratch

2创建libs目录

3导入新模块

3 Import new module

4导入使用Maven模型holoeverywhere

4 Import holoeverywhere using Maven model

5导入设置




5 Import settings

6添加依赖主应用程序模块


6 Add dependencies to main application module

7移动Holoeverywhere DIR图书馆


7 Move Holoeverywhere dir to libraries

8更改父模块名称

8 Change parent module name

9添加依赖性摇篮文件

9 Add dependence to gradle files

10更改进口活动

10 Change imports in Activity

11运行结果

11 Run result

12的另一种尝试设置依赖

12 Another attempt to set dependent

请给我同样的想法如何纠正进口holoeverywhere

Please give me same idea how to correct import holoeverywhere

推荐答案

我同意@ 7wonders,但进口矿项目HoloEverywhere将使更大的问题比它进口HoloEverywhere。

I agree with @7wonders , but importing mine project to HoloEverywhere would make bigger problem than importing HoloEverywhere in it.

克隆HoloEverywhere,项目内部之后,你有文件夹命名为图书馆。
首先,我把它复制到项目的根文件夹雷库,并更名为HoloEverywhere。

After cloning HoloEverywhere, inside of project you have folder named "library". Firstly, I copied it to mine folder "libraries" in project's root and renamed it to "HoloEverywhere".

其次,我已经编辑的build.gradle文件中这样HoloEverywhere文件夹:

Secondly, I've edited "build.gradle" file in HoloEverywhere folder like this:

     apply plugin: 'android-library'

  android {
    compileSdkVersion 19
    buildToolsVersion '19.0.0'

  defaultConfig {
     minSdkVersion 7
  }

  sourceSets {

    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        res.srcDirs = ['res']
    }

}
}


dependencies {
   compile files('libs/support-v4-18.0.4.jar')
   compile files('libs/nineoldandroids-2.4.0.jar')
 }

第三,加入project`s根文件夹settings.gradle

Thirdly, added to "settings.gradle" in project`s root folder

   include ":libraries:HoloEverywhere"

与包括项目的前行。

before line with include of your project.

毕竟,我们应该命名为yourprojectname文件夹内的build.gradle添加文件库HoloEveryWhere我们的主要项目的依赖。

After all we should add library HoloEveryWhere to our main project dependencies in "build.gradle" file inside YourProjectName folder.

    dependencies {             
             compile project(':libraries:HoloEverywhere')
    }

不要忘了从项目中移除依赖支持-V4和放大器;支持-V7库。

Don't forget to remove from project dependencies support-v4 & support-v7 libraries.

最后不要忘记清洁工程。选择Android的Studio的菜单中选择生成>清理项目。
我建议通过终端来做到这一点,因为你无法看到运行窗口中的所有错误。
  所以选择Tools>打开终端
首先,你应该导航到项目的根(命令CD ..),并调用:

Finally don't forget to clean project. Choose from Android Studio's Menu Build>Clean Project. I recommend to do it via Terminal, because you can't see all errors in Run window. so choose Tools>Open Terminal firstly you should navigate to project root(command "cd ..") and call:

UNIX:
         ./gradlew干净

UNIX: ./gradlew clean

Windows系统:
        gradlew.bat干净

Windows: gradlew.bat clean

成功的清洗后,生成项目。

After successful cleaning build your project.

在构建我有错误,有在AndroidManifest.xml中没有应用程序标签
在HoloEverywhere库。所以只需添加它,现在一切正常。

While build I've got error that there is no "application" tag in AndroidManifest.xml in HoloEverywhere library. So just add it and now everything is OK.

一大一小,也许最糟糕的,剩下要做的:阅读基本迁移和更改所有进口资源(布局),并覆盖有类的方法从HoloEverywhere库忽略ClassCastException异常。

One small, maybe the worst, thing left to do: read basic migration and change all imports, resources(layouts) and override methods with classes from HoloEverywhere library to ignore ClassCastException.

享受:)

这篇关于添加Holoeverywhere Android Studio中项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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