crow-misia / libmediasoup-android

libmediasoupclient for Android
Apache License 2.0
10 stars 9 forks source link

Error while building . #84

Closed JojoStacy closed 2 months ago

JojoStacy commented 2 months ago

I have followed all the steps for building the library including building webrtc using https://github.com/crow-misia/libwebrtc-bin. Now when it comes to building libmediasoup android I get this error ld.lld: error: undefined symbol: jni_zero::JavaRef<_jobject>::JavaRef(_JNIEnv, _jobject*)

referenced by jni_zero.h:203 (/Volumes/Data/Projects/Android2/libmediasoup-android/core/deps/webrtc/include/third_party/jni_zero/jni_zero.h:203) CMakeFiles/mediasoupclient_so.dir/src/main/jni/send_transport.cpp.o:(jni_zero::JavaRef<_jobjectArray>::JavaRef(_JNIEnv, _jobjectArray)) referenced by jni_zero.h:203 (/Volumes/Data/Projects/Android2/libmediasoup-android/core/deps/webrtc/include/third_party/jni_zero/jni_zero.h:203) CMakeFiles/mediasoupclient_so.dir/src/main/jni/data_producer.cpp.o:(jni_zero::JavaRef<_jbyteArray>::JavaRef(_JNIEnv, _jbyteArray)) referenced by jni_zero.h:291 (/Volumes/Data/Projects/Android2/libmediasoup-android/core/deps/webrtc/include/third_party/jni_zero/jni_zero.h:291) CMakeFiles/mediasoupclient_so.dir/src/main/jni/consumer.cpp.o:(jni_zero::ScopedJavaLocalRef<_jobject>::ScopedJavaLocalRef(_JNIEnv, _jobject*)) referenced 3 more times I am new .Kindly assist . I have checked all other resources but am stuck. I need to make minor adjustments to the lib for my use case .Thank you

crow-misia commented 2 months ago

First, please provide a description of what you have done to do this.

Also, WebRTC versions above m124 are not supported. Therefore, even if you bring the latest version from libwebrtc-bin, you will not be able to make it work.

JojoStacy commented 2 months ago
  1. I created webrtc from bwebrtc-bin and got to download the libwertc-android.tar.xz
  2. The I used it to build the libmediasoupclient using the cmake command sudo cmake . -Bbuild \ -DLIBWEBRTC_INCLUDE_PATH:PATH=/Volumes/Data/Projects/CProjects/libwebrtc-android/include \ -DLIBWEBRTC_BINARY_PATH:PATH=/Volumes/Data/Projects/CProjects/libwebrtc-android/lib \ -DMEDIASOUPCLIENT_BUILD_TESTS="true" \ -DCMAKE_CXX_FLAGS="-fvisibility=hidden" 3.I then cloned libmediasoup-android and inside deps I put both the libmediasoupclient folder and also and the libwebrtc-android unzipped and renamed webrtc. 4.I then tried to build it using cmake and that is the error that keeps coming.

Could be that am using a version of webrtc above m124 .If so how can I in ibwebrtc-bin specify a version lower than that ? Thanks so much for your initial response

JojoStacy commented 2 months ago

I have made changes in the VERSION file and I have put this CCACHE_VERSION=4.9 WEBRTC_VERSION=m123.6312@{#3} WEBRTC_SEMANTIC_VERSION=123.6312.3.0 WEBRTC_COMMIT=41b1493ddb5d98e9125d5cb002fd57ce76ebd8a7

PACKAGE_NAMES= \ linux-arm \ linux-arm64 \ linux-x64 \ macos-x64 \ macos-arm64 \ ios \ android

DOCKER_PACKAGE_NAMES= \ linux-arm \ linux-arm64 \ linux-x64 \ android. I am currently building. I am I on the right track ?

crow-misia commented 2 months ago

If you are building libwebrtc, use branch m123.6312.

  1. write the version of libwebrtc in the VERSIONS of this repository. This version must match the tag name of libwebrtc-bin.

  2. Run following commands to download and patch libwebrtc and libmediasoup.

    cd core/scripts/
    ./get-deps.sh
  3. run ./gradlew build directly under the project to build library.

Do not run cmake directly.

JojoStacy commented 2 months ago

noted thanks so so much ! You are the best . Trying this out!

JojoStacy commented 2 months ago

Thanks that worked