yasirkula / UnityIonicIntegration

A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
104 stars 32 forks source link

ios issue #63

Open seepot opened 4 years ago

seepot commented 4 years ago

i got this error when archive

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/yusriharun/Documents/project/menarakl/platforms/ios/unityLibrary/Libraries/libiPhone-lib.a(unwind_test_arm64.o) ld: entry point (_main) undefined. for architecture arm64

here is full error

Ld /Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/InstallationBuildProductsLocation/Applications/KL\ Tower.app/KL\ Tower normal arm64 (in target: KL Tower) cd /Users/yusriharun/Documents/project/menarakl/platforms/ios export IPHONEOS_DEPLOYMENT_TARGET=11.0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -L/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos -L/Users/yusriharun/Documents/project/menarakl/platforms/ios/unityLibrary/Libraries -L/Users/yusriharun/Documents/project/menarakl/platforms/ios/unityLibrary/Libraries/Mapbox/Core/Plugins/iOS/MapboxMobileEvents -L/Users/yusriharun/Documents/project/menarakl/platforms/ios -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKCoreKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKLoginKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKShareKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKCoreKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKLoginKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKShareKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKCoreKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKLoginKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKShareKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKCoreKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKLoginKit -F/Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/FBSDKShareKit -filelist /Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/IntermediateBuildFilesPath/KL\ Tower.build/Release-iphoneos/KL\ Tower.build/Objects-normal/arm64/KL\ Tower.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=11.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/IntermediateBuildFilesPath/KL\ Tower.build/Release-iphoneos/KL\ Tower.build/Objects-normal/arm64/KL\ Tower_lto.o -Xlinker -final_output -Xlinker /Applications/KL\ Tower.app/KL\ Tower -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -weak_framework AVFoundation -weak_framework Coremotion -weak-lSystem -framework AssetsLibrary -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreMotion -framework CoreText -framework CoreVideo -framework Foundation -framework iAd -framework MediaPlayer -framework OpenGLES -framework OpenAL -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit /Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/BuildProductsPath/Release-iphoneos/libCordova.a -framework Security -framework SystemConfiguration -weak_framework AudioToolbox -framework CoreLocation -weak_framework WebKit -weak_framework Social -lMapboxMobileEventsStatic -liPhone-lib -weak_framework MessageUI -framework MapKit -framework Pods_KL_Tower -lil2cpp -Xlinker -dependency_info -Xlinker /Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/IntermediateBuildFilesPath/KL\ Tower.build/Release-iphoneos/KL\ Tower.build/Objects-normal/arm64/KL\ Tower_dependency_info.dat -o /Users/yusriharun/Library/Developer/Xcode/DerivedData/KL_Tower-fptmvsgjnghtcnbpxkxxvtdkdnvn/Build/Intermediates.noindex/ArchiveIntermediates/KL\ Tower/InstallationBuildProductsLocation/Applications/KL\ Tower.app/KL\ Tower

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/yusriharun/Documents/project/menarakl/platforms/ios/unityLibrary/Libraries/libiPhone-lib.a(unwind_test_arm64.o) ld: entry point (_main) undefined. for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

yasirkula commented 4 years ago

You didn't remove Other Sources/main.mm from Xcode, right? You need to remove only Unity/Classes/main.mm. Quoted from the documentation:

seepot commented 4 years ago

i can archive when change Mach-O type from Executable to Bundle but can't upload to Play Store.

got this error

App Store Connect Operation Error ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'KL Tower.app/KL Tower' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."

App Store Connect Operation Error ERROR ITMS-90124: "The binary is invalid. The executable 'KL Tower.app/KL Tower' has type 'BUNDLE' that is not valid. Only 'EXECUTE' is permitted."

App Store Connect Operation Error ERROR ITMS-90210: "Missing load commands. The executable at 'KL Tower.app' does not have the necessary load commands. Try rebuilding the app with the latest Xcode version. If you are using third party development tools, contact the provider."

yasirkula commented 4 years ago

Did you verify the main.mm thing I've mentioned in my previous post?

seepot commented 4 years ago

yes.. main.mm only remain in other sources only and remove reference in Unity/Classes/main.mm


for this step ->

Open Classes/UnityAppController.h in Unity group and find the following function:
inline UnityAppController* GetAppController()
{
    return (UnityAppController*)[UIApplication sharedApplication].delegate;
}

in that file only found this code ->

extern UnityAppController* GetAppController();

yasirkula commented 4 years ago

Something might have changed in the latest version of Unity, I am not sure. For the time being, I don't know why this issue is occurring.

yasirkula commented 4 years ago

P.S. If you want, you can try this integration method: https://forum.unity.com/threads/using-unity-as-a-library-in-native-ios-android-apps.685195/

seepot commented 4 years ago

do i need to match framework with export unity?

yasirkula commented 4 years ago

Do you mean .NET Framework version or something else?