Comments (3)
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)
-- The argument is the "undecorated" library name, so to load "libfubar.so" you would pass in "fubar".
from android-native-dependencies.
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,
~Jeremy
from android-native-dependencies.
Interesting...
AFAIK SqlCipher never made it to maven central (or any other public repo) see issue #33
so I guess you're installing manually the lib using mvn install:install
if this is the case, you need to follow the convention above, so maven will create the correct POM.xml (without the lib prefix as part of the artifact name)
Example:
- remove previous installation of SqlCipher
rm -Rf ~/.m2/repository/net/sqlitecipher/
- install correctly the native lib
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.
from android-native-dependencies.
Related Issues (10)
- How to use with local library projects?
- Should be able to define artifacts for specific build types HOT 1
- Could you change the lib directory? HOT 3
- arm64 support HOT 2
- Unsupported major.minor version 52.0 HOT 4
- How to update .so files if they are updated but not changed versions in Maven server? HOT 2
- can not download transitive so dependencies HOT 2
- ArtifactNotFoundException does not fail build
- Gradle 7.0 compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-native-dependencies.