AppLovin / AppLovin-MAX-Unity-Plugin

125 stars 34 forks source link

Unity iOS looking for mbed tls framework on Unity Cloud Build #117

Open ChrisMasterton opened 2 years ago

ChrisMasterton commented 2 years ago

I was having trouble with the Swift frameworks, which I figured out after upgrading to the Unity SDK 5.0. (I needed to link the Swift libraries statically through the Google external dependency manager iOS settings).

Now that the swift frameworks are linking correctly I am getting linker errors about other missing frameworks, is this something related to (and missing from) the new Unity 5.0 SDK?

Fixed - mbed tls: fixed - fixed by adding the lib to the podfile. Next linker error - seems to be missing a libpvx framework that I'm having trouble tracking down.

I am using unity 2020.3.19, xcode 13, unity cloud build

Thanks!

ChrisMasterton commented 2 years ago

@santoshbagadi any thoughts on this? ^^^

Did I do something obviously wrong when installing the SDK?

santoshbagadi commented 2 years ago

Hi @ChrisMasterton , do you mind sharing the exact error you are seeing in your console. I'm not quite sure what the issue could be. Could you also share the AppLoin MAX Unity plugin version and Android and iOS SDK versions you are using?

ChrisMasterton commented 2 years ago

Thanks @santoshbagadi . I've included the output below:

▸ Linking UnityFramework
⚠?  ld: arm64 function not 4-byte aligned: _unwind_tester from /BUILD_PATH/reel-fx-inc.22422_rumblematch.rmbl-dev-ios-daily/temp20220112-4891-1wry11/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
⚠?  ld: Incompatible Objective-C category definitions. Some category metadata may be lost. '/BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzpyfywwvisjeoahwmbhxrgyuurh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/AppLovinSDK/AppLovinSDK.framework/AppLovinSDK(UIColor+ALUtils.o)' and '/BUILD_PATH/reel-fx-inc.22422_rumblematch.rmbl-dev-ios-daily/temp20220112-4891-1wry11/Libraries/libiPhone-lib.a(PLCrashReportTextFormatter.o) built with different compilers
⚠?  ld: method '-viewDidAppear:' in category from /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzpyfywwvisjeoahwmbhxrgyuurh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityViewControllerBase+iOS.o overrides method from class in /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzpyfywwvisjeoahwmbhxrgyuurh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityViewControllerBase.o
▸ Copying UnityAppController.h
▸ Copying UnityFramework.h
▸ Copying UndefinePlatforms.h
▸ Generating 'UnityFramework.framework.dSYM'
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_init
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_free
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_grow
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_shrink
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_copy
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_safe_cond_assign
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_safe_cond_swap
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_lset
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_get_bit
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_set_bit
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_lsb
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_bitlen
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_size
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_read_string
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_mul_int
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_add_int
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_sub_int
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_read_binary
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_write_binary
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_shift_l
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_shift_r
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_cmp_abs
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_cmp_mpi
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_cmp_int
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_add_abs
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_sub_abs
    (arm64)  could not find object file symbol for symbol _mpi_sub_hlp
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_add_mpi
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_sub_mpi
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_mul_mpi
    (arm64)  could not find object file symbol for symbol _mpi_mul_hlp
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_div_mpi
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_mod_mpi
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_mod_int
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_exp_mod
    (arm64)  could not find object file symbol for symbol _mpi_montmul
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_gcd
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_fill_random
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_inv_mod
    (arm64)  could not find object file symbol for symbol _mbedtls_mpi_is_prime
    (arm64)  could not find object file symbol for symbol _mpi_is_prime_internal
    (arm64)  could not find object file symbol for symbol _mpi_check_small_factors
    (arm64)  could not find object file symbol for symbol _mpi_miller_rabin
    (arm64)  could not find object file symbol for symbol _small_prime
    (arm64)  could not find object file symbol for symbol _vp8_default_coef_probs
    (arm64)  could not find object file symbol for symbol _vp8_coef_update_probs
    (arm64)  could not find object file symbol for symbol _vp8_norm
    (arm64)  could not find object file symbol for symbol _vp8_mb_feature_data_bits
    (arm64)  could not find object file symbol for symbol _default_coef_probs
▸ Copying RedefinePlatforms.h
▸ Copying RenderPluginDelegate.h
▸ Copying LifeCycleListener.h
▸ Running script 'Run Script'
▸ Running script 'Unity Process symbols'
▸ Running script '[CP] Copy Pods Resources'
▸ Touching UnityFramework.framework (in target 'UnityFramework' from project 'Unity-iPhone')
▸ Running script 'AppLovinQualityService Updater'
▸ Running script '[CP] Check Pods Manifest.lock'
▸ Copying /BUILD_PATH/reel-fx-inc.22422_rumblematch.rmbl-dev-ios-daily/temp20220112-4891-1wry11/Data
▸ Compiling LaunchScreen-iPhone.storyboard
▸ Compiling LaunchScreen-iPad.storyboard
▸ Processing Info.plist
▸ Compiling main.mm
▸ Linking RumbleMatch
❌  ld: symbol(s) not found for architecture arm64
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)
** ARCHIVE FAILED **
The following build commands failed:
    Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-fzpyfywwvisjeoahwmbhxrgyuurh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/APPLICATION_PATH/RumbleMatch.app/RumbleMatch normal (in target 'Unity-iPhone' from project 'Unity-iPhone')
(1 failure)
Exit status: 65
Maybe the error shown is caused by using the wrong version of Xcode
Found multiple versions of Xcode in '/APPLICATION_PATH/'
Make sure you selected the right version for your project
This build process was executed using '/APPLICATION_PATH/Xcode13_0_0.app'
If you want to update your Xcode path, either
- Specify the Xcode version in your Fastfile
▸ xcversion(version: "8.1") # Selects Xcode 8.1.0
- Specify an absolute path to your Xcode installation in your Fastfile
▸ xcode_select "/APPLICATION_PATH/Xcode8.app"
- Manually update the path using
▸ sudo xcode-select -s /APPLICATION_PATH/Xcode.app
+-------------+-------------------------------+
|              Build environment              |
+-------------+-------------------------------+
| xcode_path  | /APPLICATION_PATH/Xcode13_0_0.app |
| gym_version | 2.182.0                       |
| sdk         | iPhoneOS15.0.sdk              |
+-------------+-------------------------------+
▸   "_GADAdLoaderAdTypeNative", referenced from:
▸       -[ALGoogleMediationAdapter loadAdViewAdForParameters:adFormat:andNotify:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
▸       -[ALGoogleMediationAdapter loadNativeAdForParameters:andNotify:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
▸ ld: symbol(s) not found for architecture arm64
▸ clang: error: linker command failed with exit code 1 (use -v to see invocation)
⬆?  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
??  For the complete and more detailed error log, check the full log at:
??  /BUILD_PATH/Library/Logs/gym/RumbleMatch-Unity-iPhone.log
Looks like fastlane ran into a build/archive error with your project
It's hard to tell what's causing the error, so we wrote some guides on how
to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
Before submitting an issue on GitHub, please follow the guide above and make
sure your project is set up correctly.
fastlane uses `xcodebuild` commands to generate your binary, you can see the
the full commands printed out in yellow in the above log.
Make sure to inspect the output above, as usually you'll find more error information there

My delay in replying was to make an update to the Google External Dependency resolver which fixed this issue. (I changed the filename name from GvhProjectSettings.xml to GvhProjectSettings.asset to stop Perforce from throwing an exception).

Version numbers are: Applovin MAX plugin 5.0.1 iOS & Android 11.0.0 Facebook android_6.8.0.3_ios_6.9.0.2 Admob android_20.5.0.3_ios_8.12.0.3 (not at latest) IronSource android_7.1.10.1.0_ios_7.1.13.0.0 (not at latest) Mintegral android_15.8.1.2_ios_7.0.4.0.1 Unity Ads android_4.0.0.0_ios_4.0.0.0

External Dependency Manager is 1.2.164 (+my hack change to make it work with Perforce & Unity Cloud Build)

santoshbagadi commented 2 years ago

@ChrisMasterton , it looks like you might on an older AdMob SDK that doesn't have the GADAdLoaderAdTypeNative constant. AdMob has added the constant in 8.12.0. Do you mind checking the generated Podfile.lock to make sure that the right AdMob version is being pulled in.

ChrisMasterton commented 2 years ago

hi @santoshbagadi I updated everything to the latest and confirmed that AdMob was on 8.12.x. These errors are using Unity Cloud Build, if I build locally I don't get the linker errors. I'm going to contact Unity and see if they have any insights, but if you think of anything else I can try, please let me know.

ChrisMasterton commented 2 years ago

We are also now seeing problems with Android builds on Unity Cloud Build - we are using Perforce as source control.

[Unity] ERROR: Error [AppLovin MAX] Failed to remove AppLovin Quality Service Plugin from mainTemplate.gradle. Please remove the Quality Service plugin from the mainTemplate.gradle manually.
[Unity] UnityEngine.StackTraceUtility:ExtractStackTrace ()
[Unity] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
[Unity] UnityEngine.Logger:Log (UnityEngine.LogType,object)
[Unity] UnityEngine.Debug:Log (object)
[Unity] UnityEditor.CloudBuild.BuildLogger:Log (string)
[Unity] UnityEditor.CloudBuild.BuildLogger:HighlightUnityErrors (string,string,UnityEngine.LogType)
[Unity] UnityEngine.Application:CallLogCallback (string,string,UnityEngine.LogType,bool)
[Unity] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
[Unity] UnityEngine.Logger:Log (UnityEngine.LogType,object)
[Unity] UnityEngine.Debug:LogError (object)
[Unity] MaxSdkLogger:UserError (string) (at Assets/MaxSdk/Scripts/MaxSdkLogger.cs:55)
[Unity] AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinProcessGradleBuildFile:RemoveAppLovinQualityServiceOrSafeDkPlugin (string) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs:148)
[Unity] AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinPreProcessAndroid:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessAndroid.cs:41)
[Unity] UnityEditor.Build.BuildPipelineInterfaces/<>c__DisplayClass15_0:<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport)
[Unity] UnityEditor.Build.BuildPipelineInterfaces:InvokeCallbackInterfacesPair<UnityEditor.Build.IPreprocessBuild, UnityEditor.Build.IPreprocessBuildWithReport> (System.Collections.Generic.List`1<UnityEditor.Build.IPreprocessBuild>,System.Action`1<UnityEditor.Build.IPreprocessBuild>,System.Collections.Generic.List`1<UnityEditor.Build.IPreprocessBuildWithReport>,System.Action`1<UnityEditor.Build.IPreprocessBuildWithReport>,bool)
[Unity] UnityEditor.Build.BuildPipelineInterfaces:OnBuildPreProcess (UnityEditor.Build.Reporting.BuildReport)
[Unity] UnityEditor.BuildPipeline:BuildPlayerInternal (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[])
[Unity] UnityEditor.BuildPipeline:BuildPlayer (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[])
[Unity] UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
[Unity] UnityEditor.BuildPipeline:BuildPlayer (string[],string,UnityEditor.BuildTarget,UnityEditor.BuildOptions)
[Unity] UnityEditor.CloudBuild.Builder:BuildPlayerDefault (UnityEditor.BuildPlayerOptions)
[Unity] UnityEditor.CloudBuild.Builder:BuildPlayer (UnityEditor.BuildPlayerOptions)
[Unity] UnityEditor.CloudBuild.Builder:Build ()
[Unity] (Filename: Assets/MaxSdk/Scripts/MaxSdkLogger.cs Line: 55)
santoshbagadi commented 2 years ago

Hi @ChrisMasterton , it looks like our plugin is trying to update the mainTemplate.gradle file but is failing. We also write the exception to the console below the log attached above. Could you please check if the exception is logged as well and attach it here so that we can investigate further.

ChrisMasterton commented 2 years ago

I believe its related to our combination of Perforce & Unity Cloud Build. Changes a file at build time causes UCB to attempt to checkout the file from Perforce. This checkout is failing and the exception is thrown. It is a uniquely UCB & Perforce issue that's been brought up on GEDM github. I'll post the link when I find it.