General Android projects from Eclipse to Android Studio (hereinafter referred to as), there will be a variety of problems, the most important is that "gradle" so far not supported. So library files packaged into the APK.
That is, if you are using a third-party library that contains. So files (typically libs\armeabi\ xxx.so), then just "system.loadlibrary" ("XXX") appears in the Code; When the code appears, it will definitely throw an exception unsatisfiedlinkerror here.
The solution is as follows: According to my Google for 2 days results, a more satisfactory and all the people who have this problem is feasible:
1) Create an empty folder "Lib" at any location on the hard disk (note that the name is "Lib" instead of "Libs")
2) Copy the Armeabi folder from the original Libs directory to the newly created Lib directory. (The. So file in the Armeabi folder will also be copied in)
3) package The newly created "Lib" directory into a. zip file and rename it "Armeabi.jar"
4) put Armeabi.jar into the original Libs directory (and other third-party jar packages)
After these 4 steps, it is OK to just re-update the third-party library under as.
Another method, copy the jar package to the Libs folder and view the open Module Settings Are they connected before
Set the following directly in the Build.gradle file in module:
dependencies {
compile filetree (dir:
' Libs '
' *.jar '
)
}
If it is a library of engineering class, put the project in the same directory as the main project and set it as below in the Build.gradle settings
Associating remote libraries
Compile ' com.github.project:2.2 '
Android Studio Imports third-party libraries, including the. So class