Goal: The migration succeeds and runs successfully!
Add: Sync video behind the article!
Two different ways:
1. Export with Gradle, import with Gradle in Android Studio (not recommended)
2. Import the Eclipse project directly with Android Studio (recommended)
Me in the second way.
Steps:
- Eclipse Engineering ( master project + dependent third-party library )
- Import master project (dependent libraries ignore, studio will automatically import)
- Wait for buildafter import (may be slow, recommended SSD)
- There will be a lot of errors, slowly troubleshooting, one by one to see the log
- Error1: A duplicate resource file (String) that can be searched globally to see if it is duplicated, as is not allowed to duplicate the resource definition.
- ERROR2: Annotations * * @null * * Dependency error, adding
compile ‘com.android.support:support-annotations:19.1.0‘
- OK, it's working.
Error Append: Manifest file Error:
Add a namespace after the root tagxmlns:tools="http://schemas.android.com/tools"
<applicationandroid:name="com.fanwe.app.App"android:allowBackup="true"android:icon="@drawable/icon"android:label="@string/app_name"android:theme="@style/FanweTheme"tools:replace="icon, label,theme">//Android Studio会引导你使用tools标签来进行设置:tools:replace="icon, label,theme"
End:
In fact, the second way is very simple, there is nothing special to pay attention to the place, to, there is a file to note, because some files as not copied over and ignored them.
In the import-summary.txt there is a Ignored Files: note that the specific type of file will be ignored by Android studio.
There is a blog to explain this, I also put in the back of the article:
Android Studio ignores file explanation-blog Park
This article synchronizes video operation recording: Click to download
Finished =.=
Eclipse Engineering migration to Android Studio