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, addingcompile ‘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 will guide you through the Tools tab to set it up: 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.
Eclipse Engineering migrated to Android Studio