kerasking / maven-android-plugin

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

"Destination "XXX.so" already exists", error in NdkBuildMojo's FileUtils.moveFile ? #322

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a project based on the examples supplied with the plugin. In the NDK 
build phase it looks like a file copy fails if there is an old target .so file:

What steps will reproduce the problem?
1. git clone -b jochen-c-tape-android-review https://github.com/square/tape
2. cd tape
3. mvn test
4. mvn test

What is the expected output?
no errors

What do you see instead?

"[ERROR] Error while executing: Destination 
'/Users/jochen/src/tape/c-tape-android/native/target/libc-tape-android-native.so
' already exists"

'mvn clean test' will work.

I identified the problem to be in the NdkBuildMojo, which should check that the 
old library is cleaned up 
 first? the source code seems to do so, but I'm not sure? I hope I'm not doing anything dumb.

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

3.3.2

What are the complete output lines of "mvn -version" on your machine?

Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)
Maven home: /usr/share/maven
Java version: 1.6.0_37, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac"

Please provide any additional information below.

As discussed in forum 
(https://groups.google.com/forum/?fromgroups=#!searchin/maven-android-developers
/from:jochen/maven-android-developers/m68eV8c6wEw/FWZNgGL6hZoJ)

See tape/c-tape-android/native/pom.xml

I did try to add cleanup code like:

<clearNativeArtifacts>true</clearNativeArtifacts> 
<deleteConflictingFiles>true</deleteConflictingFiles> 

but that didn't help.

running with -X shows:

INFO] /Users/jochen/android-ndk/ndk-build [-C, 
/Users/jochen/src/tape/c-tape-android/native, 
NDK_TOOLCHAIN=arm-linux-androideabi-4.4.3, c-tape-android-native]
[DEBUG] make: Entering directory `/Users/jochen/src/tape/c-tape-android/native'
[DEBUG] Compile thumb  : c-tape-android-native <= queuefilenative.c
[DEBUG] Compile thumb  : c-tape-android-native <= jniutils.c
[DEBUG] Compile thumb  : c-tape-android-native <= fileio.c
[DEBUG] Compile thumb  : c-tape-android-native <= logutil.c
[DEBUG] Compile thumb  : c-tape-android-native <= queuefile.c
[DEBUG] SharedLibrary  : libc-tape-android-native.so
[INFO] 
/Users/jochen/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin
-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideab
i/bin/ld: Warning: 
/Users/jochen/android-ndk/platforms/android-3/arch-arm/usr/lib/crtend_so.o: 
Unknown EABI object attribute 44
[DEBUG] make: Leaving directory `/Users/jochen/src/tape/c-tape-android/native'
[DEBUG] ANDROID-040-000: Executed command: Commandline = /bin/sh -c cd 
/Users/jochen/src/tape/c-tape-android/native && 
/Users/jochen/android-ndk/ndk-build -C 
/Users/jochen/src/tape/c-tape-android/native 
NDK_TOOLCHAIN=arm-linux-androideabi-4.4.3 c-tape-android-native, Result = 0
[DEBUG] Post processing (stripping) native compiled artifact: 
/Users/jochen/src/tape/c-tape-android/native/obj/local/armeabi/libc-tape-android
-native.so
[DEBUG] Detected shared library artifact, will now strip it
[DEBUG] ANDROID-040-000: Executed command: Commandline = /bin/sh -c 
/Users/jochen/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin
-x86/bin/arm-linux-androideabi-strip 
/Users/jochen/src/tape/c-tape-android/native/obj/local/armeabi/libc-tape-android
-native.so, Result = 0
[DEBUG] Adding native compiled artifact: 
/Users/jochen/src/tape/c-tape-android/native/obj/local/armeabi/libc-tape-android
-native.so
[DEBUG] Moving native compiled artifact to target directory for preservation
[INFO] Cleaning up native library output directory after build
[DEBUG] Removing directory: /Users/jochen/src/tape/c-tape-android/native/obj
[INFO] Cleaning up extracted include directories used for build
[ERROR] Error while executing: Destination 
'/Users/jochen/src/tape/c-tape-android/native/target/libc-tape-android-native.so
' already exists

Original issue reported on code.google.com by joc...@squareup.com on 15 Nov 2012 at 1:12

GoogleCodeExporter commented 9 years ago

Original comment by johanlin...@gmail.com on 10 Dec 2012 at 6:30

GoogleCodeExporter commented 9 years ago
We are no longer using the issue tracking system on Google Code. Please refile 
this issue on https://github.com/jayway/maven-android-plugin/issues if you 
still have this problem with the latest release of the Android Maven Plugin

Original comment by mosa...@gmail.com on 19 May 2014 at 4:19