Skip to content

Commit 5bc3904

Browse files
committed
copy native/shared libraries (.so files) to correct place /app/src/main/jniLibs
1 parent 82d9bad commit 5bc3904

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mode/src/processing/mode/android/AndroidBuild.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ private void createAppModule(String moduleName)
381381

382382
// Copy any imported libraries (their libs and assets),
383383
// and anything in the code folder contents to the project.
384-
copyImportedLibs(libsFolder, assetsFolder);
384+
copyImportedLibs(libsFolder, mainFolder, assetsFolder);
385385
copyCodeFolder(libsFolder);
386386

387387
// Copy any system libraries needed by the project
@@ -867,7 +867,8 @@ protected boolean ignorableImport(String pkg) {
867867
* For each library, copy .jar and .zip files to the 'libs' folder,
868868
* and copy anything else to the 'assets' folder.
869869
*/
870-
private void copyImportedLibs(final File libsFolder,
870+
private void copyImportedLibs(final File libsFolder,
871+
final File mainFolder,
871872
final File assetsFolder) throws IOException {
872873
for (Library library : getImportedLibraries()) {
873874
// add each item from the library folder / export list to the output
@@ -887,7 +888,12 @@ private void copyImportedLibs(final File libsFolder,
887888
exportName.equals("armeabi-v7a") ||
888889
exportName.equals("x86")) {
889890
Util.copyDir(exportFile, new File(libsFolder, exportName));
890-
} else {
891+
}
892+
// Copy jni libraries (.so files) to the correct location
893+
else if (exportName.equals("jniLibs")) {
894+
Util.copyDir(exportFile, new File(mainFolder, exportName));
895+
}
896+
else {
891897
// Copy any other directory to the assets folder
892898
Util.copyDir(exportFile, new File(assetsFolder, exportName));
893899
}

0 commit comments

Comments
 (0)