Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios issue #63

Open
seepot opened this issue Feb 11, 2020 · 8 comments
Open

ios issue #63

seepot opened this issue Feb 11, 2020 · 8 comments

Comments

@seepot
Copy link

seepot commented Feb 11, 2020

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
Copy link
Owner

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

  • Change the contents of Other Sources/main.mm with Classes/main.mm (located in Unity group) and replace const char* AppControllerClassName = "UnityAppController"; with const char* AppControllerClassName = "AppDelegate"; (in Other Sources/main.mm)
  • Remove Classes/main.mm in Unity group from your Xcode project using Remove References

@seepot
Copy link
Author

seepot commented Feb 27, 2020

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
Copy link
Owner

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

@seepot
Copy link
Author

seepot commented Feb 27, 2020

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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Author

seepot commented Feb 28, 2020

do i need to match framework with export unity?

@yasirkula
Copy link
Owner

Do you mean .NET Framework version or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants