I just wanted to reply to let you know that SWIG was 2.04 for my Ubuntu install as you mentioned and installing the latest SWIG release (2.09) worked like a charm after also installing libpcre3-dev/g++. Now it builds properly even with the jni.h from the android NDK and the android app doesn't crash anymore. I can now telnet in and provide commands. I would suggest updating the wiki article at https://trac.pjsip.org/repos/wiki/Getting-Started/Android to clarify that SWIG 2.05 or greater is needed for it to build properly with the NDK. Thanks again, Kevin ---------------------------------------------------------------------- Date: Thu, 16 May 2013 23:58:46 +0700 From: Riza Sulistyo <riza@xxxxxxxxx> To: pjsip list <pjsip at lists.pjsip.org> Subject: Re: Current Trunk - PJSUA for Android not building w/o extra steps - Android app crashing on run Message-ID: <CAJg9p00aqckELxiA2ZLM7k+AVYBvvTFdj0NpV-5-MnHOdiQvSw at mail.gmail.com> Content-Type: text/plain; charset=windows-1252 Hi, Could you please check your swig version ? The minimum swig version needed is 2.0.5. (http://admin.blogs.docilnet.fr/articles/java-swig-pour-android-ndk-sous-ubuntu.html). The swig current version in ubuntu is 2.0.4 and you need to manually install it (www.swig.org/download.html). Be informed that swig needs libpcre3-dev and g++. Regards, Riza On Thu, May 16, 2013 at 7:17 AM, Kevin LaMar <KLaMar at vertical.com> wrote: > > I am able to build the apjsua branch without problems and the apjsua Android app runs properly with that libpjsua_app.so. > > > > However, with the android subdirectory that was added to the trunk for > pjsua recently, I have not been able to build/run successfully with > the new instructions on > https://trac.pjsip.org/repos/wiki/Getting-Started/Android > > > > I am running Ubuntu 11.10 32-bit, with android-ndk-r8e. > > > > The configure and make commands all work fine, but when I do the ndk-build command I receive the following error while trying to make the pjsua_wrap.o: > > > > Invoking SWIG... > > swig -c++ -o jni/pjsua_wrap.cpp -package org.pjsip.pjsua -outdir > src/org/pjsip/pjsua -java jni/pjsua.i > > Compile++ thumb : pjsua <= pjsua_wrap.cpp > > jni/pjsua_wrap.cpp: In constructor 'Swig::Director::JNIEnvWrapper::JNIEnvWrapper(const Swig::Director*)': > > jni/pjsua_wrap.cpp:335:73: error: invalid conversion from 'void**' to > 'JNIEnv** {aka _JNIEnv**}' [-fpermissive] > > /home/android/android-ndk-r8e/platforms/android-14/arch-arm/usr/include/jni.h:1072:10: error: initializing argument 1 of 'jint _JavaVM::AttachCurrentThread(JNIEnv**, void*)' [-fpermissive] > > make: *** [obj/local/armeabi/objs/pjsua/pjsua_wrap.o] Error 1 > > > > I found the following thread which sounds exactly like what I ran > into: > http://swig.10945.n7.nabble.com/Java-AttachCurrentThread-cast-error-td > 557.html > > > > After reading, I decided I would try taking the jni.h (and dependencies jawt_md.h/jni_md.h) from my 1.7.0_01 JDK folder, and placing them in /home/android/android-ndk-r8e/platforms/android-14/arch-arm/usr/include/ to see if it would build using Java?s jni.h. This fixed the build problem and ndk-build now builds the .so without issue. If this is a necessary step, then it should be added to the wiki page. > > > > I then continued to follow the wiki entry and made the project in eclipse from existing source and it built fine (I?m using target Android SDK version 14 ? Android 4.0). I then tried to run on a 4.0 simulator, a rooted Motorola Xoom tablet, and a Samsung Galaxy SIII, all of which crash with the following LogCat tracing: > > > > 05-15 17:12:22.140: E/dalvikvm(21762): ERROR: detaching thread with > interp frames (count=18) > > 05-15 17:12:22.140: I/dalvikvm(21762): "main" prio=5 tid=1 RUNNABLE > > 05-15 17:12:22.140: I/dalvikvm(21762): | group="main" sCount=0 dsCount=0 obj=0x4184d568 self=0x4183d9f8 > > 05-15 17:12:22.140: I/dalvikvm(21762): | sysTid=21762 nice=0 sched=0/0 cgrp=apps handle=1075250992 > > 05-15 17:12:22.140: I/dalvikvm(21762): | schedstat=( 106848000 16932000 106 ) utm=5 stm=5 core=0 > > 05-15 17:12:22.140: I/dalvikvm(21762): at org.pjsip.pjsua.pjsuaJNI.pjsuaStart(Native Method) > > 05-15 17:12:22.140: I/dalvikvm(21762): at org.pjsip.pjsua.pjsua.pjsuaStart(pjsua.java:13) > > 05-15 17:12:22.140: I/dalvikvm(21762): at org.pjsip.pjsua.MainActivity.init_lib(MainActivity.java:234) > > 05-15 17:12:22.140: I/dalvikvm(21762): at org.pjsip.pjsua.MainActivity.onCreate(MainActivity.java:153) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.Activity.performCreate(Activity.java:5008) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.ActivityThread.access$600(ActivityThread.java:130) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.os.Handler.dispatchMessage(Handler.java:99) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.os.Looper.loop(Looper.java:137) > > 05-15 17:12:22.140: I/dalvikvm(21762): at android.app.ActivityThread.main(ActivityThread.java:4745) > > 05-15 17:12:22.140: I/dalvikvm(21762): at java.lang.reflect.Method.invokeNative(Native Method) > > 05-15 17:12:22.140: I/dalvikvm(21762): at java.lang.reflect.Method.invoke(Method.java:511) > > 05-15 17:12:22.140: I/dalvikvm(21762): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) > > 05-15 17:12:22.140: I/dalvikvm(21762): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) > > 05-15 17:12:22.140: I/dalvikvm(21762): at dalvik.system.NativeStart.main(Native Method) > > 05-15 17:12:22.140: E/dalvikvm(21762): VM aborting > > 05-15 17:12:22.140: A/libc(21762): Fatal signal 11 (SIGSEGV) at > 0xdeadd00d (code=1), thread 21762 (org.pjsip.pjsua) > > > > If I comment out Line #230 of MainActivity.java which sets a callback object, the pjsuaStart() function returns without exception and the app does not crash, however it?s stuck on ?Starting module?. > > > > Is there anyone out there who can help with these issues? Is it something I?m doing wrong? I have followed the instructions to the letter and am still facing these problems. > > > > Thanks, > > Kevin > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > ------------------------------ Subject: Digest Footer _______________________________________________ pjsip mailing list pjsip at lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org ------------------------------ End of pjsip Digest, Vol 69, Issue 68 *************************************