devopvoid / webrtc-java

WebRTC for desktop platforms running Java
Apache License 2.0
248 stars 60 forks source link

mvn install failed #125

Closed Andriel-lore closed 8 months ago

Andriel-lore commented 8 months ago

Can't compile project

To Reproduce

  1. fetch project
  2. run 'mvn install'

Expected behavior Build successful

Additional context Machine chip: Apple M2 error message: [ERROR] Failed to execute goal com.googlecode.cmake-maven-project:cmake-maven-plugin:3.22.1-b1:compile (cmake-compile) on project webrtc-java-jni: Return code: 2 -> [Help 1] [ERROR]

devopvoid commented 8 months ago

Should be fixed now, as of ce6c046. Version 0.8.0 has now as well the macOS arm64 release.

Andriel-lore commented 8 months ago

Thank you for looking into the issue [#125]. However, the original behavior reported still seems to be occurring in the latest update. I'm available to provide any further information if needed.

devopvoid commented 8 months ago

Please provide further information. The error message is just error notification, not the cause.

Andriel-lore commented 8 months ago
  1. when i run cmake compile (stand alone, not as part of the chain of mvn install) i am getting this error: 
 The parameters 'projectDirectory' for goal com.googlecode.cmake-maven-project:cmake-maven-plugin:3.22.1-b1:compile are missing or invalid

  2. Hope this will help
Just copy and paste the logs from running `mvn install’ 
(not the first time, after fetching the webrtc lib)
I removed personal properties (local paths) and replaced them with place holder{LOCAL-PATH} (just for preventing confuse, sometimes {LOCAL-PATH} != {LOCAL-PATH} becuase they pointing to another path>

[INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] webrtc-java-parent [pom] [INFO] webrtc-java-jni [pom] [INFO] webrtc-java [jar] [INFO] [INFO] ----------------< dev.onvoid.webrtc:webrtc-java-parent >---------------- [INFO] Building webrtc-java-parent 0.9.0-SNAPSHOT [1/3] [INFO] from pom.xml [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- compiler:3.10.1:compile (base-compile) @ webrtc-java-parent --- [INFO] No sources to compile [INFO] [INFO] --- install:3.0.0-M1:install (default-install) @ webrtc-java-parent --- [INFO] Installing {LOCAL-PATH}AndroidStudioProjects/NOT_IMPORTANT_2/webrtc-java/pom.xml to {LOCAL-PATH}.m2/repository/dev/onvoid/webrtc/webrtc-java-parent/0.9.0-SNAPSHOT/webrtc-java-parent-0.9.0-SNAPSHOT.pom [INFO] [INFO] -----------------< dev.onvoid.webrtc:webrtc-java-jni >------------------ [INFO] Building webrtc-java-jni 0.9.0-SNAPSHOT [2/3] [INFO] from webrtc-jni/pom.xml [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- cmake:3.22.1-b1:generate (cmake-generate) @ webrtc-java-jni --- [INFO] Downloading binaries to {LOCAL-PATH}/webrtc-java/webrtc-jni/target/dependency/cmake [INFO] Configured Artifact: com.googlecode.cmake-maven-project:cmake-binaries:mac-universal:3.22.1-b1:jar [INFO] cmake-binaries-3.22.1-b1-mac-universal.jar already unpacked. [INFO] Executing {LOCAL-PATH}/webrtc-java/webrtc-jni/target/dependency/cmake/bin/cmake -- WebRTC checkout path: {LOCAL-PATH}/webrtc -- WebRTC checkout branch: branch-heads/4844 -- WebRTC target: macos arm64 -- WebRTC build type: Release -- WebRTC install path: {LOCAL-PATH}/webrtc/build -- WebRTC: fetch Running: gclient root Your current directory appears to already contain, or be part of, a checkout. "fetch" is used only to get new checkouts. Use "gclient sync" to update existing checkouts.

Fetch also does not yet deal with partial checkouts, so if fetch failed, delete the checkout and start over (crbug.com/230691). -- WebRTC: checkout "branch-heads/4844" Updated 0 paths from the index HEAD is now at 4d7f57adca [Merge M99] Check for valid transport before setting criteria. -- WebRTC: sync WARNING: 'src/third_party/libunwind/src' is no longer part of this client. It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/libc++abi/src' is no longer part of this client. It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/libc++/src' is no longer part of this client. It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/grpc/src' is no longer part of this client. It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/flatbuffers/src' is no longer part of this client. It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/clang-format/script' is no longer part of this client. It is recommended that you manually remove it or use 'gclient sync -D' next time. ____ running 'python3 src/build/landmines.py --landmine-scripts src/tools_webrtc/get_landmines.py --src-dir src' in '{LOCAL-PATH}/webrtc' ____ running 'python3 src/third_party/depot_tools/update_depot_tools_toggle.py --disable' in '{LOCAL-PATH}/webrtc' ____ running 'python3 src/build/mac_toolchain.py' in '{LOCAL-PATH}/webrtc' Skipping Mac toolchain installation for mac ____ running 'python3 src/tools/clang/scripts/update.py' in '{LOCAL-PATH}webrtc' ____ running 'python3 src/build/util/lastchange.py -o src/build/util/LASTCHANGE' in '{LOCAL-PATH}/webrtc' ____ running 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' in '{LOCAL-PATH}/webrtc' ____ running 'download_from_google_storage --no_resume --extract --no_auth --bucket chromium-fonts -s src/third_party/test_fonts/test_fonts.tar.gz.sha1' in '{LOCAL-PATH}webrtc' ____ running 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/resources' in '{LOCAL-PATH}/webrtc' ____ running 'vpython3 src/testing/generate_location_tags.py --out src/testing/location_tags.json' in '{LOCAL-PATH}/webrtc' ____ running 'vpython3 -vpython-spec src/.vpython3 -vpython-tool install' in '/{LOCAL-PATH}/webrtc' Updating depot_tools... -- WebRTC: generate Done. Made 1089 targets from 253 files in 1164ms -- WebRTC: compile ninja: Entering directory out/arm64' [1/848] LINK ./rgba_to_i420_converter FAILED: rgba_to_i420_converter TOOL_VERSION=1698825599 ../../build/toolchain/apple/linker_driver.py -Wcrl,strippath,{LOCAL-PATH}Downloads/DELETE/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip ../../third_party/llvm-build/Release+Asserts/bin/clang++ -fuse-ld=lld -Wl,-fatal_warnings -Wl,--icf=all -Wl,--color-diagnostics -stdlib=libc++ -arch arm64 -no-canonical-prefixes -Wl,-dead_strip -isysroot ../../../../Downloads/DELETE/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.11.0 -Wl,-ObjC -o "./rgba_to_i420_converter" "@./rgba_to_i420_converter.rsp" env: python: No such file or directory [2/848] AR obj/third_party/libvpx/libvpx.a [3/848] CC obj/third_party/opus/opus/table_LSF_cos.o [4/848] CC obj/third_party/opus/opus/tables_LTP.o [5/848] CC obj/third_party/opus/opus/tables_NLSF_CB_NB_MB.o [6/848] CC obj/third_party/opus/opus/stereo_find_predictor.o [7/848] CC obj/third_party/opus/opus/stereo_decode_pred.o [8/848] CC obj/third_party/opus/opus/stereo_encode_pred.o [9/848] CC obj/third_party/opus/opus/stereo_quant_pred.o [10/848] CC obj/third_party/opus/opus/sum_sqr_shift.o ninja: build stopped: subcommand failed. -- Configuring done -- Generating done -- Build files have been written to: {LOCAL-PATH}/webrtc-java/webrtc-jni/target/macos-aarch64 [INFO] [INFO] --- cmake:3.22.1-b1:compile (cmake-compile) @ webrtc-java-jni --- [INFO] Downloading binaries to {LOCAL-PATH}/webrtc-java/webrtc-jni/target/dependency/cmake [INFO] Configured Artifact: com.googlecode.cmake-maven-project:cmake-binaries:mac-universal:3.22.1-b1:jar [INFO] cmake-binaries-3.22.1-b1-mac-universal.jar already unpacked. [INFO] Executing {LOCAL-PATH}webrtc-java/webrtc-jni/target/dependency/cmake/bin/cmake Consolidate compiler generated dependencies of target jni-voithos [ 16%] Built target jni-voithos Consolidate compiler generated dependencies of target webrtc [ 16%] Building CXX object dependencies/webrtc/CMakeFiles/webrtc.dir/pseudo.cxx.o [ 17%] Linking CXX static library libwebrtc.a warning: {LOCAL-PATH}Downloads/DELETE/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: libwebrtc.a the table of contents is empty (no object file members in the library define global symbols) [ 17%] Built target webrtc Consolidate compiler generated dependencies of target webrtc-java make[2]: *** No rule to make target{LOCAL-PATH}/webrtc/src/out/arm64/obj/libwebrtc.a', needed by `libwebrtc-java.dylib'. Stop. make[1]: [CMakeFiles/webrtc-java.dir/all] Error 2 make: [all] Error 2 [WARNING] Command: [{LOCAL-PATH}/webrtc-java/webrtc-jni/target/dependency/cmake/bin/cmake, --build, {LOCAL-PATH}/webrtc-java/webrtc-jni/target/macos-aarch64, --target, install] [WARNING] Directory: null [WARNING] Environment: {} [WARNING] Exit code: 2 [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for webrtc-java-parent 0.9.0-SNAPSHOT: [INFO] [INFO] webrtc-java-parent ................................. SUCCESS [ 0.229 s] [INFO] webrtc-java-jni .................................... FAILURE [ 23.149 s] [INFO] webrtc-java ........................................ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23.423 s [INFO] Finished at: 2023-11-01T10:07:46+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.googlecode.cmake-maven-project:cmake-maven-plugin:3.22.1-b1:compile (cmake-compile) on project webrtc-java-jni: Return code: 2 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :webrtc-java-jni

devopvoid commented 7 months ago

Your log says env: python: No such file or directory. I guess you have to install python first.

Andriel-lore commented 7 months ago

missed it, sorry. anyway, `mvn install' succeed. trying to use the lib, cant make it. there is problem with the native loader (tried to run test and it failed in dev.onvoid.webrtc.TestBase#initFactory) . actually exception is being thrown here: dev.onvoid.webrtc.internal.NativeLoader#loadLibrary

try (InputStream is = NativeLoader.class.getClassLoader().getResourceAsStream(libFileName)) {
            Files.copy(is, tempPath, StandardCopyOption.REPLACE_EXISTING);
        }
        catch (Exception e) {
            tempFile.delete();

            throw e;
        }

if i unserstand correctly the InputStrem (is) is null

Andriel-lore commented 7 months ago

Maybe it is worth to mention that i copy libwebrtc-java.dylib from: webrtc-jni/target/lib/ to: webrtc/src/main/resources/ and now it is working

Andriel-lore commented 7 months ago

dont know why but no RTCIceCandidate is generated (after generating and setting local offer sucessfully)