Wednesday, April 3, 2013

[android-developers] Why does Android sometimes post-fix a application's package name at installation?

Hi all,

Apologies for the cross post as i've recently raised this issue the android-ndk group but raising again as someone here may know the answer.

I'm having a problem when using vs-android to build an Android native application using a NativeActivity class. The application i'm building is the NDK's NativeActivity source sample. Using the command line ndk-build and ant to build the sample works perfectly however using vs-android results in this error:

04-03 10:21:55.974: E/AndroidRuntime(7254): Caused by: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.example.native_activity-1/libnative-activity.so

Looking at the NativeActivity source actually suggests that the native lib could be found, as it's path is valid, but the function loadNativeCode failed, (the onCreate function isn't being stripped as i've checked the .so).

I realise this is probably a vs-android issue and so is outside the scope of this group however i have a question regarding the addition of the package post-fix characters.

When i build the sample using ndk-build the application is installed to:
 com.example.native_activity

but the sample built using vs-android installs it here:
 com.example.native_activity-1
or sometimes even here:
 com.example.native_activity-2

Does anyone know why the -1 is being post-fixed?
Does anyone know how to make sure the -1 isn't post-fixed?
Can this be controlled?

The reason i'm questioning the post-fix addition is vs-android used to build and run the sample without problems; the application was installed without the -1 post-fix. :(

Many thanks in advance for any help and/or advice offered.
Andy Slater

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment