Android eclipse转studio的流程及问题
来源:互联网 发布:软件开发毕业设计题目 编辑:程序博客网 时间:2024/05/20 22:41
废话不说进入正题,我感觉也没有人看我的废话...
网上说有两种办法,这里只写其一:
打开Import
- 新用户:
- 老用户: File-->Import Project
- 新用户:
直接找到原有的Eclipse工程
- 单一工程直接导入即可。
- 有库工程的需要注意,导入一定要指向主工程,而不是整个项目的目录。指向项目目录是无法进行转换的。
- 单一工程直接导入即可。
- 指定目标路径
这个地方需要详细说一下
这里上面两个选项暂且不说,勾选上。
最后一项提一下: 将Module名创建为camelCase风格。
驼峰式,这个搞Java的都会熟悉,camelCase表示首字母小写的驼峰式风格,CamelCase表示首字母大写的驼峰式风格。
不勾选这个选项意味着你原先的工程名是啥样,转换完就是啥样。
当然也有例外,比如countly-sdk-android转换完就成了countlysdkandroid,下划线我就不知道了,这个没有再仔细研究规则,不过CamelCase会保持正常。之后需要经过一段时间的转换。成功后可以看到import-summary.txt,这个文件非常有用,后面会讲到。
到这里,你的应用其实已经可以通过AndroidStudio正常编译,你也可以写代码去了。
但我希望你还能继续看下去,因为这个成功后弹出来的import-summary.txt写了些很重要的东西。
这里的import-summary.txt文件是非常非常重要的文件,基本上你成功的导入还是失败都是靠这个文件,有可能你和我一样,都有一个毛病,见到英文本能的略过,只有比较重要的时候才好好看看翻译一下.所以这里,这个文件是比较重要的,你要全部的都翻译出来,你的导入的成功率才会大,这句话是本文的重中之重.
现在看第一部分
ECLIPSE ANDROID PROJECT IMPORT SUMMARY======================================Manifest Merging:-----------------Your project uses libraries that provide manifests, and your Eclipseproject did not explicitly turn on manifest merging. In Android Gradleprojects, manifests are always merged (meaning that contents from yourlibraries' manifests will be merged into the app manifest. If you hadmanually copied contents from library manifests into your app manifestyou may need to remove these for the app to build correctly.
第一部分让你明白一些 这里就不献丑翻译了
看第二部分
Ignored Files:--------------The following files were *not* copied into the new Gradle project; youshould evaluate whether these are still needed in your project and ifso manually move them:From Test:* Thumbs.db* android.keystore* ic_launcher-web.png* proguard-project.txtFrom libraryListView:* LICENSE* pom.xmlFrom playdemo:* proguard-project.txt第二部分是忽略的东西 有些东西要加上去的哦 我导入之后忽略的东西就这么多 这些东西都不用加上去
接下来是第三部分
Replaced Jars with Dependencies:--------------------------------The importer recognized the following .jar files as third partylibraries and replaced them with Gradle dependencies instead. This hasthe advantage that more explicit version information is known, and thelibraries can be updated automatically. However, it is possible thatthe .jar file in your project was of an older version than thedependency we picked, which could render the project not compileable.You can disable the jar replacement in the import wizard and try again:android-support-v4.jar => com.android.support:support-v4:19.1.0意思是 一些本来的东西用谷歌线上的东西代替了.
第四部分
Moved Files:------------Android Gradle projects use a different directory structure than ADTEclipse projects. Here's how the projects were restructured:In libraryListView:* AndroidManifest.xml => libraryListView\src\main\AndroidManifest.xml* assets\ => libraryListView\src\main\assets* res\ => libraryListView\src\main\res\* src\ => libraryListView\src\main\java\这里的意思是把一些东西移动了位置
最后一部分
Next Steps:-----------You can now build the project. The Gradle project needs networkconnectivity to download dependencies.Bugs:-----If for some reason your project does not build, and you determine thatit is due to a bug or limitation of the Eclipse to Gradle importer,please file a bug at http://b.android.com with categoryComponent-Tools.(This import summary is for your information only, and can be deletedafter import once you are satisfied with the results.)加重了自己的理解,让自己理解更深一些,对于Bugs的问题 我没有碰到
解决方法:
在build.gradle的android{…}里面加上
[html] view plaincopy
packagingOptions {
exclude ‘META-INF/DEPENDENCIES’
exclude ‘META-INF/NOTICE’
exclude ‘META-INF/LICENSE’
exclude ‘META-INF/LICENSE.txt’
exclude ‘META-INF/NOTICE.txt’
}
packagingOptions 应该放到最前面才生效,放到最后面经试验不行。
- Android eclipse转studio的流程及问题
- Eclipse && Android Studio 连接手机的问题及解决方案
- Eclipse工程导入Android Studio遇到的问题及解决方法
- eclipse项目转android studio的问题
- eclipse转android studio的各种蓝瘦香菇 android studio的各种编译问题及解决方法
- eclipse 转 android studio (使用及遇到的问题集合)
- Android Studio导入SlidingMenu流程详解及相关问题
- eclipse转android studio常遇到的问题
- Eclipse转Android Studio 项目过程中遇到的问题
- Android eclipse转studio过程中遇到的问题
- Eclipse项目转Android studio项目遇到的问题
- Eclipse转Android Studio遇到的问题小结
- 从Eclipse导入Android Studio的问题
- android studio 导入eclipse工程的问题
- eclipse到android studio遇到的问题
- Android Studio导入Eclipse工程及相关问题
- Eclipse 迁移 Android Studio遇到问题及解决方案
- Android Studio 导入eclipse工程步骤及一些问题
- 2017百度前端开发
- Map集合,Queue集合
- HDU1698 Just a Hook(线段树成段替换)
- 修改系统状态栏颜色
- 对FreeStreamer的单例形式封装
- Android eclipse转studio的流程及问题
- Spark与Hive的交互
- 设计模式学习之代理模式(一)
- java8改进的HashMap和Hashtable类
- 栈
- Codeforces 627A XOR Equation
- BZOJ2393: Cirno的完美算数教室 容斥原理
- [数位DP] HDU 3555 Bomb
- php string去掉emoji表情