BigKarel / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

Invalid LOCAL_MODULE_FILENAME for native libraries in local Maven repository #410

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install maven-android-plugin-samples to the local Maven repository using 
"mvn install"
2. Create a project that depends on the native-code so artifact
3. Run mvn android:ndk-build and see the generated libs/ directory

What is the expected output?

libs/armeabi/native-code.so

What do you see instead?

libs/armeabi/native-code-1.0.0-SNAPSHOT-armeabi.so
-->
System.loadLibrary calls will fail unless version + classifier are included
+
The resulting APK will contain the library twice.

What version of maven-android-plugin are you using?

3.6.0

Here's an example section from a generated android_maven_plugin_makefile.mk:

#
# Group ID: com.jayway.maven.plugins.android.generation2.samples
# Artifact ID: native-code
# Artifact Type: so
# Version: 1.0.0-SNAPSHOT
include $(CLEAR_VARS)
LOCAL_MODULE    := native-code
LOCAL_PATH := 
../../../.m2/repository/com/jayway/maven/plugins/android/generation2/samples/nat
ive-code/1.0.0-SNAPSHOT
LOCAL_SRC_FILES := native-code-1.0.0-SNAPSHOT-armeabi.so
LOCAL_MODULE_FILENAME := native-code-1.0.0-SNAPSHOT-armeabi
LOCAL_EXPORT_C_INCLUDES := 
/tmp/android_maven_plugin_native_includes1374836718591_native-code
include $(PREBUILT_SHARED_LIBRARY)

The problem happens because LOCAL_MODULE_FILENAME is set directly based on 
Artifact.getFile() name with extension dropped. This probably makes sense (?) 
for native libraries in apklib dependencies, but for normal *.so files 
Artifact.getArtifactId() should be used instead.

Original issue reported on code.google.com by Joonas.J...@gmail.com on 26 Jul 2013 at 11:14

GoogleCodeExporter commented 9 years ago
Pull request with fix available at:

https://github.com/jayway/maven-android-plugin/pull/223

Original comment by Joonas.J...@gmail.com on 26 Jul 2013 at 11:22

GoogleCodeExporter commented 9 years ago
will be released with 3.6.1

Original comment by mosa...@gmail.com on 30 Jul 2013 at 3:41