Project

General

Profile

Actions

Bug #835

open

Building mobile libs fails at step iOS Framework because of undefined symbols

Added by Andreas Ganske almost 2 years ago. Updated almost 2 years ago.

Status:
Solved
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/22/2022
Due date:
% Done:

0%

Estimated time:
Reviewer:
Build Version:

Description

I am trying to build v2.1.5 under macOS with an Apple Silicon chip (arm64) with the following invocation (I skip the tests because actually two are failing in the step "Mobile Lib"):

mvn install -Dmaven.test.skip=true -P build-mobile-libs

I get the following error:

[...]
[INFO] Building iOS Framework 2.1.5                                     [51/51]
[...]
[INFO] Linking 6869 classes (ios arm64 release)
[INFO] 47278 methods out of 58067 included in the executable
[INFO] Building framework binary /Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/OpenEcard
[INFO] /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/OpenEcard -arch arm64 -Wl,-filelist,/Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/objects0 -w -stdlib=libc++ -miphoneos-version-min=8.0 -fembed-bitcode -isysroot /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk -dynamiclib -single_module -compatibility_version 1 -current_version 1 -install_name @rpath/OpenEcard.framework/OpenEcard -L /Users/Andreas/.m2/repository/com/mobidevelop/robovm/robovm-dist/2.3.10/unpacked/robovm-2.3.10/lib/vm/ios/arm64 -ObjC -exported_symbols_list /Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/exported_symbols -Wl,-no_implicit_dylibs -Wl,-dead_strip -fPIC -lrobovm-frameworksupport -lrobovm-bc -force_load /Users/Andreas/.m2/repository/com/mobidevelop/robovm/robovm-dist/2.3.10/unpacked/robovm-2.3.10/lib/vm/ios/arm64/librobovm-rt.a -lrobovm-core -lgc -lpthread -ldl -lm -lz -liconv -lsqlite3 -framework Foundation -framework MobileCoreServices
[ERROR] Undefined symbols for architecture arm64:
[ERROR]   "_[j]java.lang.Object.getClass()Ljava/lang/Class;[lookup]", referenced from:
[ERROR]       _[J]org.slf4j.helpers.SubstituteLogger.isDelegateEventAware()Z in SubstituteLogger.class.o
[ERROR] ld: symbol(s) not found for architecture arm64
[ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Open eCard Client 2.1.5:
[INFO] 
[INFO] Open eCard Client .................................. SUCCESS [  2.095 s]
[INFO] Src-Parent ......................................... SUCCESS [  0.135 s]
[INFO] Open eCard Webservice Definitions .................. SUCCESS [  0.028 s]
[INFO] Open eCard WS common ............................... SUCCESS [  1.136 s]
[INFO] Open eCard WS classes .............................. SUCCESS [  7.801 s]
[INFO] JAXB Marshaller .................................... SUCCESS [  1.164 s]
[INFO] Open eCard I18n .................................... SUCCESS [  0.046 s]
[INFO] Open eCard Common Libs ............................. SUCCESS [  3.485 s]
[INFO] CardInfo files ..................................... SUCCESS [  0.082 s]
[INFO] Add-on Framework ................................... SUCCESS [  0.556 s]
[INFO] Crypto packages .................................... SUCCESS [  0.023 s]
[INFO] Crypto common ...................................... SUCCESS [  0.726 s]
[INFO] SAL ................................................ SUCCESS [  0.018 s]
[INFO] SAL common ......................................... SUCCESS [  0.466 s]
[INFO] Android Marshaller ................................. SUCCESS [  0.456 s]
[INFO] Open eCard TLS ..................................... SUCCESS [  1.018 s]
[INFO] IFD implementations ................................ SUCCESS [  0.050 s]
[INFO] IFD common ......................................... SUCCESS [  0.366 s]
[INFO] SmartcardIO implementations ........................ SUCCESS [  0.015 s]
[INFO] PCSC SmartcardIO ................................... SUCCESS [  0.240 s]
[INFO] GUI implementations ................................ SUCCESS [  0.013 s]
[INFO] Swing GUI .......................................... SUCCESS [  0.590 s]
[INFO] IFD core ........................................... SUCCESS [  0.384 s]
[INFO] Tiny SAL ........................................... SUCCESS [  0.476 s]
[INFO] Management ......................................... SUCCESS [  0.094 s]
[INFO] Control Interface Bindings ......................... SUCCESS [  0.007 s]
[INFO] HTTP Binding ....................................... SUCCESS [  1.003 s]
[INFO] Graphics ........................................... SUCCESS [  0.198 s]
[INFO] About Dialog ....................................... SUCCESS [  0.128 s]
[INFO] IFD protocols ...................................... SUCCESS [  0.009 s]
[INFO] PACE protocol ...................................... SUCCESS [  0.266 s]
[INFO] Mobile NFC SmartcardIO ............................. SUCCESS [  0.488 s]
[INFO] Android NFC SmartcardIO ............................ SUCCESS [  0.357 s]
[INFO] iOS based NFC SmartcardIO .......................... SUCCESS [  0.602 s]
[INFO] Add-on Modules ..................................... SUCCESS [  0.031 s]
[INFO] PIN Management Add-on .............................. SUCCESS [  0.351 s]
[INFO] Generic cryptography protocol ...................... SUCCESS [  0.247 s]
[INFO] TR-03112 Add-on .................................... SUCCESS [  0.732 s]
[INFO] Chipgateway Add-on ................................. SUCCESS [  0.407 s]
[INFO] Status ............................................. SUCCESS [  0.093 s]
[INFO] Client Implementations ............................. SUCCESS [  0.007 s]
[INFO] Rich Client ........................................ SUCCESS [  1.026 s]
[INFO] Mobile Lib ......................................... SUCCESS [  1.904 s]
[INFO] Android Common ..................................... SUCCESS [  0.218 s]
[INFO] Android Lib ........................................ SUCCESS [  3.105 s]
[INFO] iOS Common ......................................... SUCCESS [  0.216 s]
[INFO] iOS Lib ............................................ SUCCESS [  2.510 s]
[INFO] Packager ........................................... SUCCESS [  0.020 s]
[INFO] Rich Client (Bundle) ............................... SUCCESS [  5.605 s]
[INFO] Rich Client (Packager) ............................. SUCCESS [  0.363 s]
[INFO] iOS Framework ...................................... FAILURE [01:54 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:36 min
[INFO] Finished at: 2022-12-22T09:13:09+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.mobidevelop.robovm:robovm-maven-plugin:2.3.10:install (default) on project ios-framework: Failed to install: Command '[/Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++, -o, /Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/OpenEcard, -arch, arm64, -Wl,-filelist,/Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/objects0, -w, -stdlib=libc++, -miphoneos-version-min=8.0, -fembed-bitcode, -isysroot, /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk, -dynamiclib, -single_module, -compatibility_version, 1, -current_version, 1, -install_name, @rpath/OpenEcard.framework/OpenEcard, -L, /Users/Andreas/.m2/repository/com/mobidevelop/robovm/robovm-dist/2.3.10/unpacked/robovm-2.3.10/lib/vm/ios/arm64, -ObjC, -exported_symbols_list, /Users/Andreas/open-ecard/packager/ios-framework/target/robovm.tmp/arm64/exported_symbols, -Wl,-no_implicit_dylibs, -Wl,-dead_strip, -fPIC, -lrobovm-frameworksupport, -lrobovm-bc, -force_load, /Users/Andreas/.m2/repository/com/mobidevelop/robovm/robovm-dist/2.3.10/unpacked/robovm-2.3.10/lib/vm/ios/arm64/librobovm-rt.a, -lrobovm-core, -lgc, -lpthread, -ldl, -lm, -lz, -liconv, -lsqlite3, -framework, Foundation, -framework, MobileCoreServices]' failed  (Exit value: 1) -> [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 <args> -rf :ios-framework

Is there any chance to get this compiling? I tried compiling it under Rosetta 2 (x86_64) by opening the terminal with Rosetta, but that failed as well with the same error.

I use Maven 3.8.6, Java 14 and Xcode 14.2.0. I also tried Java 11, 17 and 19 but got the same or other issues. I found different sources saying which JDK to use, could you clarify which one to use for building the mobile libs?

Actions #1

Updated by Andreas Ganske almost 2 years ago

  • Subject changed from Build mobile libs to Building mobile libs fails at step iOS Framework because of undefined symbols
Actions #2

Updated by Florian Otto almost 2 years ago

  • Assignee set to Florian Otto

I will try to reproduce this. Assuming changes due to xcode versions.

Actions #3

Updated by Andreas Ganske almost 2 years ago

Under which Xcode version should it work? Then I'll try on my side as well.

Actions #4

Updated by Neil Crossley almost 2 years ago

  • Status changed from New to In Progress

I was able to reproduce the above build on a mac for v2.1.5. We'll look into this.

Actions #5

Updated by Mike Prechtl almost 2 years ago

I wanted to provide a short update on this issue.

We're currently working on a fix. We assume that the problem is based on recent dependency updates. I will come back to you as soon as the problem is fixed.

Actions #6

Updated by Mike Prechtl almost 2 years ago

  • Status changed from In Progress to Solved

We fixed the problem and now the iOS-Framework can be built by using Java 17 and the following command:

./mvnw clean install -pl packager/ios-framework -am -P build-mobile-libs

The changes were pushed to the master branch.

Currently, we're preparing a new release with the iOS-Framework published at the Github release assets.

Actions #7

Updated by Tobias Wich almost 2 years ago

  • Assignee changed from Florian Otto to Mike Prechtl
Actions

Also available in: Atom PDF