AppLovin / AppLovin-MAX-Unity-Plugin

127 stars 35 forks source link

iOS Unity Cloud Build Failed #406

Closed kaninhot004 closed 3 months ago

kaninhot004 commented 3 months ago

MAX Plugin Version

6.6.1

Unity Version

2021.3.39f1

Device/Platform Info

iOS

Current Behavior

XCode Build Failed.

Expected Behavior

XCode Build Succeed.

How to Reproduce

After import AppLovin into project and start Unity Cloud Build it failed.

Setup

Plug-in Using: AppsFlyer, AppLovin, Facebook SDK. AppLovin Adapter Using: Facebook, Google AdMob.

Additional Info

Some Error Logs



[2024-08-08T09:14:51.954Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling AppleAuthSerializer.m

[2024-08-08T09:14:51.959Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling AppleAuthManager.m

[2024-08-08T09:14:51.963Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling AppleAuth.cpp

[2024-08-08T09:14:52.118Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling AppDelegateListener.mm

[2024-08-08T09:14:52.118Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling ActivityIndicator.mm

[2024-08-08T09:14:52.119Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling AVCapture.mm

[2024-08-08T09:14:52.406Z] - 7.4.10.2.7.4 - INFO: ▸ Compiling AFUnityUtils.mm

[2024-08-08T09:14:52.407Z] - 7.4.10.2.7.4 - INFO: ▸ Linking UnityFramework

[warning] [2024-08-08T09:14:55.065Z] - 7.4.10.2.7.4 - INFO: ▸ ⚠️  ld: ignoring duplicate libraries: '-lc++'

[warning] [2024-08-08T09:14:55.065Z] - 7.4.10.2.7.4 - INFO: ▸ ⚠️  ld: Could not find or use auto-linked library 'swiftXPC': library 'swiftXPC' not found

[warning] [2024-08-08T09:14:55.065Z] - 7.4.10.2.7.4 - INFO: ▸ ⚠️  ld: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found

[error] [2024-08-08T09:14:55.065Z] - 7.4.10.2.7.4 - INFO: ▸ ❌  ld: Undefined symbols:

[error] [2024-08-08T09:14:55.065Z] - 7.4.10.2.7.4 - INFO: ▸ ❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

[warning] [2024-08-08T09:14:55.118Z] - 7.4.10.2.7.4 - INFO: ▸     Run script build phase 'Unity Process symbols' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'UnityFramework' from project 'Unity-iPhone')

[warning] [2024-08-08T09:14:55.118Z] - 7.4.10.2.7.4 - INFO: ▸     Run script build phase 'Unity Process symbols' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Unity-iPhone' from project 'Unity-iPhone')

[2024-08-08T09:14:55.118Z] - 7.4.10.2.7.4 - INFO: ▸ ** ARCHIVE FAILED **

[2024-08-08T09:14:55.118Z] - 7.4.10.2.7.4 - INFO: ▸ The following build commands failed:

[2024-08-08T09:14:55.119Z] - 7.4.10.2.7.4 - INFO: ▸     Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ejvepzhckfqhygeihmqiunjjejqs/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone')

[2024-08-08T09:14:55.119Z] - 7.4.10.2.7.4 - INFO: ▸ (1 failure)

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Clean Succeeded

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Running script '[CP] Copy XCFrameworks'

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Running script '[CP] Copy XCFrameworks'

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Processing ResourceBundle-nanopb_Privacy-nanopb-Info.plist

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ejvepzhckfqhygeihmqiunjjejqs/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/nanopb_Privacy.bundle/PrivacyInfo.xcprivacy

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Processing ResourceBundle-FBLPromises_Privacy-PromisesObjC-Info.plist

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ejvepzhckfqhygeihmqiunjjejqs/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FBLPromises_Privacy.bundle/PrivacyInfo.xcprivacy

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying pb_encode.h

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying pb_decode.h

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying pb_common.h

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying pb.h

[2024-08-08T09:14:55.130Z] - 7.4.10.2.7.4 - INFO: ▸ Copying nanopb-umbrella.h

[2024-08-08T09:14:55.131Z] - 7.4.10.2.7.4 - INFO: ▸ Copying FBLPromisePrivate.h

[2024-08-08T09:14:55.131Z] - 7.4.10.2.7.4 - INFO: ▸ Copying PromisesObjC-umbrella.h

[2024-08-08T09:14:55.131Z] - 7.4.10.2.7.4 - INFO: ▸ Copying FBLPromises.h```
applovinAsh commented 3 months ago

@kaninhot004 - we have not had any other reports of this issue. Please try to do the following:

  1. Check Library/Framework Availability: Make sure swiftXPC and CoreAudioTypes are correctly included in your project settings and available in your build environment.
  2. Resolve Undefined Symbols: Identify and define any missing symbols or ensure the required libraries are linked correctly.
  3. Clean Up Build Settings: Remove any unnecessary duplicate library references and optimize the script build phases to avoid unnecessary executions.
kaninhot004 commented 3 months ago

Thanks I will try that.

JonathanLiuApp commented 3 months ago

@kaninhot004 could you try updating Xcode to 15.4 and see if that fixes your issue?

kaninhot004 commented 3 months ago

@kaninhot004 could you try updating Xcode to 15.4 and see if that fixes your issue?

Thanks for solution, but I can't do it because Unity Cloud Build only support 15.2 at this moment.

image

JonathanLiuApp commented 3 months ago

Did you happen to upgrade FB recently? This seems to be an issue with FB, so we would recommend rolling back any FB upgrades until Unity Cloud Build supports Xcode 15.4.

kaninhot004 commented 3 months ago

Yes Facebook SDK are required to update because of policy. So I will wait Unity Cloud Build to support new XCode.

I will close this issue now. Thank you so much!

stepanfiala commented 1 month ago

I have a similar issue. Maybe it is rather connected with CocoaPods installation. In my case, the build also faied to create the .xcworkspace file which might have caused the issues with linking the libraries.

@JonathanLiuApp Are there any recommended steps to make sure CocoaPods get properlly installed during Unity Cloud Build? Do we have to manually run pod install in a post-build script?

Thank you!

JonathanLiuApp commented 1 month ago

@stepanfiala Cocoapods should automatically install and create an .xcworkspace file unless there is an issue with your podfile or the pods it contains. Running the command pod install --repo-update and then rebuilding fixes a lot of Cocoapods build issues that I have run into with Unity.

Could you share the build logs so we can take a look at why your Cocoapods installation failed?

stepanfiala commented 1 month ago

@JonathanLiuApp Thanks a lot!

So far I've only added a pre-build script that upgrades cocoapods to version 1.15.2 (as I was recommended by the Unity Support) but it didn't help.

Here is my log, any help highly appreciated!

stepan-fiala-letter-fair-ios-release-46-letterfair-unity-iphone.log

JonathanLiuApp commented 1 month ago

@stepanfiala It looks like your cocoapods installation may be failing because your IPHONEOS_DEPLOYMENT_TARGET isn't high enough. Could you try upgrading your Target Minimum iOS Version to 13.0?