1

I want to test the app with android 10 in emulator.So for that I only have "armeabi", "armeabi-v7a","arm64-v8a" in jnilibs. But running app with android 10 device(Emulator), requires x86 abi. So for that first I have downloaded ndk for x86.And the second thing is I want to generate libpjsua2.so for x86 abi. I am using pjsip library. I have referred to https://trac.pjsip.org/repos/wiki/Getting-Started/Android. What I have tried is, 1) Downloaded latest pjsip version and extracted in folder. 2) Followed the steps given in pjsip website as below,

$ cd /path/to/your/pjsip/dir
$ export ANDROID_NDK_ROOT=/path_to_android_ndk_dir 
$ ./configure-android
$ make dep && make clean && make
$ cd /path/to/your/pjsip/dir
$ make clean

# cleanup pjsua sample app
$ cd pjsip-apps/src/pjsua/android/jni
$ make clean

# also cleanup pjsua2 sample app (SWIG)
$ cd /path/to/your/pjsip/dir
$ cd pjsip-apps/src/swig
$ make clean
$ cd pjsip-apps/src/swig
$ make clean
TARGET_ABI=x86 ./configure-android --use-ndk-cflags

Got error when reached above code,

LDFLAGS =  --sysroot= -L/libs/x86/
 LIBS = -lgnustl_static  -lc -lgcc -ldl
 AR = /home/Android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
 RANLIB = /home/Android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
 TARGET_HOST = llvm-linux-android
 TARGET_ABI = x86
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `llvm-linux-android': machine `llvm' not recognized
aconfigure: error: /bin/sh ./config.sub llvm-linux-android failed

In my pjsip2.7 folder I found a folder named llvm but that is a empty folder. I doesn't know What is that. I am using cent os 7. Why I am getting this error? What do I need to do to overcome this.

Kousalya
  • 700
  • 10
  • 29

1 Answers1

0

Try compile with this builder

replace in ./config.cong you are using 2.10

# PJSIP Version to download
PJSIP_VERSION=2.10
./prepare-build-system

and then

./build
  • I am using pjsip version 2.7 in my project. So do I need to download the same version zip file to generate libpjsua2.so for x86 – Kousalya May 29 '20 at 08:18
  • @Kousalya yes, there is a defferent names of methods and you will get crashes on you app. – Евгений Куманин May 29 '20 at 08:40
  • Thank you. I downloaded pjsip 2.7 and extracted files. Opened pjsip directory in terminal and used below command, ```export ANDROID_NDK_ROOT=/home/nexge/Android/android-ndk-r21b``` ```NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=x86 ./configure-android --use-ndk-cflags``` But I got an error as below ```checking build system type... x86_64-unknown-linux-gnu checking host system type... Invalid configuration `llvm-linux-android': machine `llvm' not recognized aconfigure: error: /bin/sh ./config.sub llvm-linux-android failed ``` – Kousalya May 29 '20 at 08:54
  • do you have any idea about it – Kousalya May 29 '20 at 08:55
  • @Kousalya I faced with this troubles. until not found this builder. I build again with version 2.7 https://yadi.sk/d/-JXS7VoIOOhCUg – Евгений Куманин Jun 01 '20 at 00:17
  • thank you so much for this. I have used this in my project. When launching app I got a exception ``` java.lang.NoSuchMethodError: no static method Lorg/pjsip/pjsua2/pjsua2JNI;.SwigDirector_Endpoint_onIpChangeProgress(Lorg/pjsip/pjsua2/Endpoint;J)V``` – Kousalya Jun 01 '20 at 11:18
  • @Kousalya Are you use `java/org/pjsip/pjsua2` classes from the archive? – Евгений Куманин Jun 02 '20 at 01:45
  • 'no static method' - means you no have this method in your version of java package `org.pjsip.pjsua2`, possibly due to the difference in versions of the * .so file and the java wrapper – Евгений Куманин Jun 02 '20 at 01:49
  • I have downloaded .so file for x86 mentioned here https://yadi.sk/d/-JXS7VoIOOhCUg In my project pjsip 2.7 is used. Is that .so file in that website has different version of pjsip? – Kousalya Jun 02 '20 at 11:46
  • Also I found a folder named llvm in my pjsip2.7 folder which is empty. So I am wondering that would be a cause for the error which I mentioned already regarding llvm – Kousalya Jun 02 '20 at 12:07