New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copyToTarget function appends "lib" to file name. #1
Comments
Hi, This is the convention, the module name is used to name the generated file as a result of the build process (if you build from NDK a module name hello-jni the generated shared library will be named as libhello-jni.so) also from the http://developer.android.com/training/articles/perf-jni.html (Native Libraries Chapter)
|
Hi Nabil, Thank you for the quick reply. Where this seems to become a problem is if the module name always has "lib" prefixed to the name. Here's an example: We use SqlCipher to encrypt Sqlite DBs. SqlCipher provides native (.so) libraries that already have "lib" prefixed on the file name. For example, one of the files is "libdatabase_sqlcipher.so". When we use the plugin, an extra "lib" is prefixed on the name, so we get "liblibdatabase_sqlcipher.so", which is not correct. I'd rather modify the plugin than change the name of the files we get from the vendor. One suggestion/enhancement for the tool would be to check if "lib" is already prefixed on the name OR, have a parameter/option to control the prefixing. Thanks, |
Interesting... so I guess you're installing manually the lib using Example:
rm -Rf ~/.m2/repository/net/sqlitecipher/
mvn install:install-file -Dfile=libdatabase_sqlcipher.so -DgroupId=net.sqlitecipher -DartifactId=database_sqlcipher -Dversion=2.1.1 -Dpackaging=so -Dclassifier=armeabi notice how artifactId doesn't include the lib prefix maven will create the following POM.xml <?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sqlitecipher</groupId>
<artifactId>database_sqlcipher</artifactId>
<version>2.1.1</version>
<packaging>so</packaging>
<description>POM was created from install:install-file</description>
</project> now you can use your library using the Gradle plugin as follow: native_dependencies {
artifact 'net.sqlitecipher:database_sqlcipher:2.1.+:armeabi'
} Hopefully this will work for you. |
Hi,
Great plugin!
I found that when libs are copied to the jniLibs directory, the .so file names are appended with "lib". So if the file name was originally "test.so", it becomes "libtest.so".
This is leading to linkage problems. Is there any reason you need to append "lib" to the filenames?
Thanks!
The text was updated successfully, but these errors were encountered: