Log in or register to post comments

Changing Package Name

April 18, 2013 - 12:52am #1

Hii,

 

I want to make mltiple instance of same apk. but when i am changing the package of our application,then the application is not working,

and from cygwin terminal its not creating .so file. Plz tell me the solution.

Changing Package Name

April 25, 2013 - 4:57am #10

Hi, there are two LOCAL_MODULE in Android.mk, the first is QCAR-prebuilt as you sad, but you should also find a second one (few lines below the first one), that's the one I am itnerested in...

 

Changing Package Name

April 25, 2013 - 4:49am #9

This is in android.mk "LOCAL_MODULE := QCAR-prebuilt"

and this is in android.mk

"// Name of the native dynamic libraries to load:

 

    private static final String NATIVE_LIB_SAMPLE = "CloudReco";
    private static final String NATIVE_LIB_QCAR = "QCAR";"
Plz see theat

Changing Package Name

April 25, 2013 - 2:49am #8

Ok, if you are sure that you have defined that method, then it could be that you are loading the wrong sample lib:

in Android.mk file you should see something like:

LOCAL_MODULE := ImageTargets  

in your case, what is the value of LOCAL_MODULE ?

 

Then, in your CloudReco.java file, you should see a line like:

private static final String NATIVE_LIB_SAMPLE = "ImageTargets";

Basically, you must make sure that the NATIVE_LIB_SAMPLE is set to the same value (for instance "ImageTargets" or "CloudReco" or "MyApp") as the LOCAL_MODULE name in Android.mk.

Changing Package Name

April 25, 2013 - 1:30am #7

I have done the same thing but the application is being crashed. I am printing all the Logcat value.

 

 

04-25 13:54:56.249: I/QCAR(26175): Native library libQCAR.so loaded
04-25 13:54:56.259: D/QCAR(26175): JNI_OnLoad
04-25 13:54:56.259: I/QCAR(26175): Native library libCloudReco.so loaded
04-25 13:54:56.259: D/QCAR(26175): CloudReco::onCreate
04-25 13:54:56.269: I/System.out(26175): Provider network has been selected.
04-25 13:54:56.329: I/QCAR(26175): Activity is in PORTRAIT
04-25 13:54:56.349: D/QCAR(26175): CloudReco::onResume
04-25 13:54:56.979: I/AR(26175): QCAR has been initialized successfully
04-25 13:54:57.079: I/AR(26175): QCAR SDK version 2.0.30
04-25 13:54:57.309: W/KeyCharacterMap(26175): No keyboard for id 0
04-25 13:54:57.309: W/KeyCharacterMap(26175): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
04-25 13:54:57.309: D/Test(26175): Back button pressed!
04-25 13:54:57.309: D/QCAR(26175): CloudReco::onPause
04-25 13:54:57.399: D/QCAR(26175): CloudReco::onDestroy
04-25 13:58:17.279: W/GAV2(26500): Thread[main,5,main]: Need to call initialize() and be in fallback mode to start dispatch.
04-25 13:58:17.289: I/GAV2(26500): Thread[main,5,main]: ExceptionReporter created, original handler is com.android.internal.os.RuntimeInit$UncaughtHandler
04-25 13:58:17.379: I/System.out(26500): Provider network has been selected.
04-25 13:58:18.119: I/System.out(26500): Provider network has been selected.
04-25 13:58:18.899: I/QCAR(26500): Native library libQCAR.so loaded
04-25 13:58:18.899: D/QCAR(26500): JNI_OnLoad
04-25 13:58:18.899: I/QCAR(26500): Native library libCloudReco.so loaded
04-25 13:58:18.899: D/QCAR(26500): CloudReco::onCreate
04-25 13:58:18.909: I/System.out(26500): Provider network has been selected.
04-25 13:58:18.959: I/QCAR(26500): Activity is in PORTRAIT
04-25 13:58:18.959: W/dalvikvm(26500): No implementation found for native Lcom/naitra/CloudReco;.setActivityPortraitMode (Z)V
04-25 13:58:18.959: W/dalvikvm(26500): threadid=1: thread exiting with uncaught exception (group=0x40184560)
04-25 13:58:18.959: I/GAV2(26500): Thread[main,5,main]: Tracking Exception: setActivityPortraitMode
04-25 13:58:18.969: W/GAV2(26500): Thread[main,5,main]: dispatch call queued.  Need to call GAServiceManager.getInstance().initialize().
04-25 13:58:18.969: I/GAV2(26500): Thread[main,5,main]: Passing exception to original handler.
04-25 13:58:18.989: E/AndroidRuntime(26500): FATAL EXCEPTION: main
04-25 13:58:18.989: E/AndroidRuntime(26500): java.lang.UnsatisfiedLinkError: setActivityPortraitMode
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.naitra.CloudReco.setActivityPortraitMode(Native Method)
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.naitra.CloudReco.updateActivityOrientation(CloudReco.java:1039)
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.naitra.CloudReco.initApplication(CloudReco.java:1007)
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.naitra.CloudReco.updateApplicationStatus(CloudReco.java:862)
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.naitra.CloudReco.onCreate(CloudReco.java:678)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.os.Looper.loop(Looper.java:130)
04-25 13:58:18.989: E/AndroidRuntime(26500): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-25 13:58:18.989: E/AndroidRuntime(26500): at java.lang.reflect.Method.invokeNative(Native Method)
04-25 13:58:18.989: E/AndroidRuntime(26500): at java.lang.reflect.Method.invoke(Method.java:507)
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
04-25 13:58:18.989: E/AndroidRuntime(26500): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
04-25 13:58:18.989: E/AndroidRuntime(26500): at dalvik.system.NativeStart.main(Native Method)
 
This is the Logcat Value
 

Changing Package Name

April 25, 2013 - 1:09am #6

Ok.

So, this indicates that you don't have a setActivityPortraitMode() function in your CloudReco.cpp file, or you have defined the function name incorrecttly:

based on your package and class name (com/naitra/CloudReco)  this is the code that you should have in your CloudReco.cpp file:

 

JNIEXPORT void JNICALL
Java_com_naitra_CloudReco_setActivityPortraitMode(JNIEnv *, jobject, jboolean isPortrait)
{
    isActivityInPortraitMode = isPortrait;
}
 
 

Changing Package Name

April 25, 2013 - 12:47am #5

Its Saying that "No implementation found for native Lcom/naitra/CloudReco;.setActivityPortraitMode (Z)V"

 

Changing Package Name

April 25, 2013 - 12:35am #4

What does the Log output says ?

 

Changing Package Name

April 24, 2013 - 10:48pm #3

I changed all the package name but application is crashing now.

Changing Package Name

April 18, 2013 - 2:37am #2

Hi, 

you need to rename the functions in the Cpp file (for instance in ImageTargets.cpp), so that the native function names correspond to the package name and class name from which those functions are called;

for example, consider the renderFrame() native method; this method is declared in ImageTargetsRenderer.java and it is defined in ImageTargets.cpp as follows:

 

JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv *, jobject)
 
Suppose you rename your package from "com.qualcomm.QCARSamples.ImageTargets"   to  "com.mycompany.myproject"
 
then the renderFrame() function should be renamed to:
 
JNIEXPORT void JNICALL
Java_com_mycompany_myproject_ImageTargetsRenderer_renderFrame(JNIEnv *, jobject)

 

Also, suppose you have also renamed the Java class (not only the package) from "ImageTargetsRenderer" to "MyRenderer", then the renderFrame() function would become:

 

JNIEXPORT void JNICALL
Java_com_mycompany_myproject_MyRenderer_renderFrame(JNIEnv *, jobject)
 
This general rule applies to all the native functions that are defined in CPP and called from Java.
Log in or register to post comments