Here I import eclipse First, then go everywhere for gradle buid files, and then import Android Studio.
If you are familiar with the Gradle compilation script, you can import it directly, and then manually write the Gradle configuration file.
1. Download QQ Android SDK
Choose:
2. The resulting directory structure after decompression is:
3. To import the above sample folder into eclipse, the directory structure is as follows:
The encoding for the modified item is UTF-8:
4. Repair Library Dependencies
The code shows an error, because we did not put the QQ SDK jar package into the Libs directory.
Click the Item right button —— properities—— Android, remove the wrong dependencies:
5. Import SDK Jar Library
Copy the two jar packages under the jar/directory under the downloaded QQ Android SDK package to the project's Libs directory:
The directory structure for this project is as follows:
Then clean and recompile. There is no error in the code.
6. Import items into Android studio
The most critical step is how to import projects from Eclipse into Android studio:
Right-click Item, select “export”——android——generate gradle build Files —— then select the project package to be exported everywhere.
Then import the resulting project package into Android Studio. Will prompt an error, we need to put the project root directory in the Build.gradle file (possibly your Android studio Gradle version and Gradle version of the plugin and I have different, suggest changes to their own version of the use)
dependencies {
Classpath ' com.android.tools.build:gradle:0.12+ '
}
Instead we use the new to Gradle plug-in version:
dependencies {
Classpath ' com.android.tools.build:gradle:1.3.0 '
}
Note: If possible, you may also need to change the/gradle/wrapper/gradle-wrapper.properties in the project root directory
7. Recompile run
After the change, click “ Sync Now&rdquo, recompile the project, you will find that the project did not error, test in the simulator, everything is OK.
Android Studio version of the QQ SDK demo download (latest version)