The XMPP code of a netizen from ADT to as, found that it used a third-party class library, source code in the Lib, directly in as in the import project, the third-party class library is not automatically imported into, it seems to need to do their own hands.
The directory structure of the project is as follows:
XMPP$ lsapp build.gradle gradlew import-summary.txt XMPP.imlbuild gradle gradlew.bat local.properties settings.gradle
Copy the third-party source qqemoji-lib to this directory, modify the Settings.gradle to add this lib:
include‘:app‘,‘:qqEmoji-lib‘
Modify the Build.gradle under the app to add in dependencies:
dependencies { compile project(‘:qqEmoji-lib‘) ...
Create a new Build.gradle file under Qqemoji-lib, with the following reference:
Apply plugin:' Android-library 'Android{compilesdkversion buildtoolsversion "21.1. 2" Defaultconfig {minsdkver Sion 8 targetsdkversion }Sourcesets{main {manifest.srcfile ' androidmanifest.xml ' java.srcdirs = [' src '] Resources.srcdirs = [' src '] aidl.srcdirs = [' src '] renderscript.srcdirs = [' src '] res.srcdirs = [' res ']}}}dependencies{compile ' com.android.support:appcompat-v7:19.1.0 ' //compile ' com.android.support:support-v4 : 19.1.0 '}
The configuration content of Gradle is referred to the last second link.
At this point the structure of the project is shown:
At this point compile, pass, import success!
Reference:
Http://www.cnblogs.com/neozhu/p/3458759.html
Http://www.open-open.com/lib/view/open1415793464648.html
Android 12: Android Studio import third-party class libraries