Android Studio, Eclipse import run QQ Android SDK third party login

Source: Internet
Author: User
Tags wrapper

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.