AppLovin / AppLovin-MAX-Unreal

17 stars 5 forks source link

Error while building in unreal engine 4.27 #13

Closed awsproserve closed 1 year ago

awsproserve commented 1 year ago

MAX Plugin Version

1.1.2

Unreal Engine Version

4.27

Device/Platform Info

IOS

Current Behavior

I install the plugin to unreal engine and while trying to build the application I get the following error below. Been trying for all this week and still no avail, any help in the right direction would be greatly appreciated. Thanks - Sarah

image

Expected Behavior

The game/application should build successfully without error, and package successfully

How to Reproduce

  1. First lets down load the plugin. I navigate to the GIT repo, and download the plugin folder image

  2. Go to your downloads and find the folder we just downloaded and copy the plugin from the plugin folder image

  3. Put the applovin max plugin in your projects plugin folder image

  4. Find your [yourgame/appname].target.cs file within your project folder, open with text editor and add the following below

    // Add compiler argument to support building on macOS with Xcode 13.3+ bOverrideBuildEnvironment = true; AdditionalCompilerArguments = "-Wno-unused-but-set-variable";

image

  1. Add AppLovinMAX as a dependency to the PublicDependencyModuleNames array inside of your app’s .Build.cs file:

Add AppLovinMAX as a dependency to the PublicDependencyModuleNames array inside of your app’s .Build.cs file: for example: PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AppLovinMAX" });

Screenshot of me adding it to my app, our public dependency module name line is formatted by default different than yours, so I used it the way my project has it in in default with adding the applovin, input core, engine, and coreuobject. and I also tired it with your exact formate. see below | V image

(I just noticed that after I save this file and re open it, my changes save to the run.build.cs file, however when I try to package the app, and it fails, I go back to the run.build.cs file and it reverts back to default, is that expected? see below for the default that it reverts back to

image

now I try it exactly the way you have it in your instructions, and tried building package and still not working. it still also reverts back to default when package fails.

image

  1. Update your app’s Info.plist in Unreal’s Project Settings with network-specific identifiers. See the SKAdNetwork documentation for instructions.

image

  1. Open your project, to go file > package > IOS
image
  1. After few seconds, I get the following error

to suppress this warning. UATHelper: Packaging (iOS): Couldn't find PLCrashReporter in folder 'lib-Xcode-13.4.1', using default 'lib-Xcode-12.4' UATHelper: Packaging (iOS): Compiling against OS Version 12.0 [minimum allowed at runtime] UATHelper: Packaging (iOS): Parsing headers for run UATHelper: Packaging (iOS): Running UnrealHeaderTool "/Users/caataiwi/Documents/Unreal Projects/KZ_4.27_Avatar_nov_17_max/run.uproject" "/Users/caataiwi/Documents/Unreal Projects/KZ_4.27_Avatar_nov_17_max/Intermediate/Build/IOS/run/Shipping/run.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -absl og="/Users/caataiwi/Library/Logs/Unreal Engine/LocalBuildLogs/UHT-run-IOS-Shipping_2.txt" -installed UATHelper: Packaging (iOS): 2022-11-19 02:18:44.600 UnrealHeaderTool[80304:7868319] [UE4] Looking for binary: ../../../Engine/Programs/UnrealHeaderTool/Config/BinaryConfig.ini UATHelper: Packaging (iOS): LogInit: Display: Loading text-based GConfig.... UATHelper: Packaging (iOS): Reflection code generated for run in 4.5829604 seconds UATHelper: Packaging (iOS): Compiling with iPhoneOS SDK 15.5 UATHelper: Packaging (iOS): Zip file: /Users/caataiwi/Documents/Unreal Projects/KZ_4.27_Avatar_nov_17_max/Binaries/IOS/run-IOS-Shipping.dSYM.zip UATHelper: Packaging (iOS): Adding PostBuildSync action UATHelper: Packaging (iOS): IOSPlugin: Plugins/Runtime/AR/AppleAR/AppleARKit/Source/AppleARKit/AppleARKit_IOS_UPL.xml UATHelper: Packaging (iOS): IOSPlugin: Plugins/Marketplace/EasyAdsPro/Source/EasyAds/EasyAds_IOS_UPL.xml UATHelper: Packaging (iOS): IOSPlugin: Plugins/Marketplace/PsIronSource/Source/PsIronSource/IronSource_APL_IOS.xml UATHelper: Packaging (iOS): IOSPlugin: ../../../caataiwi/Documents/Unreal Projects/KZ_4.27_Avatar_nov_17_max/Plugins/AppLovinMAX/Source/AppLovinMAX/AppLovinMAX_UPL_IOS.xml UATHelper: Packaging (iOS): Writing manifest to /Users/caataiwi/Documents/Unreal Projects/KZ_4.27_Avatar_nov_17_max/Intermediate/Build/Manifest.xml UATHelper: Packaging (iOS): ERROR: Unable to merge actions producing AppLovinSDK.embeddedframework.extracted: prerequisites are different PackagingResults: Error: Unable to merge actions producing AppLovinSDK.embeddedframework.extracted: prerequisites are different UATHelper: Packaging (iOS): ERROR: Action graph is invalid; unable to continue. See log for additional details. PackagingResults: Error: Action graph is invalid; unable to continue. See log for additional details. UATHelper: Packaging (iOS): Took 9.091533s to run mono, ExitCode=6 UATHelper: Packaging (iOS): UnrealBuildTool failed. See log for more details. (/Users/caataiwi/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-run-IOS-Shipping_2.txt) UATHelper: Packaging (iOS): AutomationTool exiting with ExitCode=6 (6) UATHelper: Packaging (iOS): RunUAT ERROR: AutomationTool was unable to run successfully. PackagingResults: Error: AutomationTool was unable to run successfully. PackagingResults: Error: Unknown Error LogSlate: Window 'Output Log' being destroyed LogSlate: Window 'Output Log' being destroyed

image

Additional note: When I remove the plugin and revert all my changes I made, I can successfully package the IOS and upload it to apples test flight.

If anyone can please help us with what we are doing wrong here. I want to note we have't yet implemented any blueprints or code specific to the plugin, we wanted to make sure that we can package the game after we installed the plugin to make sure nothing broke. Thanks in advance for any help you can provide. :)

Additional Info

No response

ritamsarmah commented 1 year ago

Hmm yeah that's a really weird one. I'm looking into it right now, but one possible cause might be if bitcode is enabled in your project (since the newer builds we've been working on in master no longer have bitcode enabled in the iOS plugin).

Could you try packaging after disabling that under Project Settings > Platforms - iOS > Build > Uncheck "Support bitcode in Shipping"? If that doesn't work, maybe you can try experimenting with the other options under the iOS build settings in the meantime while I also continue debugging it. I appreciate the patience and cooperation as we work out these issues—it's been equally helpful for us in order to improve the plugin!

image

awsproserve commented 1 year ago

Hello thanks for the prompt response, I've checked our setup and it looks like we do have this unchecked already, we'll continue playing around with settings to see if we can get this working, let me know when you want us to try another build of the plugin and we will get on it asap, thanks so much in your partnership.

image
ritamsarmah commented 1 year ago

Hi @awsproserve, would you mind pulling and testing the latest change in the fix/default_ustruct_values branch? I tried re-exporting the framework that Unreal is complaining about.

If that doesn't work, could you verify if you're seeing the issue occur in our demo app (from the fix branch) as well?

awsproserve commented 1 year ago

Hi @ritamsarmah I just updated using the latest fix/default_ustruct_values branch you updated around 40 mins ago. to my app and still the same errors. I've also done the same for the demo project and I am still getting the same errors. here are screenshots while I tried to package your demo app

image

image

We have also just updated our app using the old plugin file that worked originally and we are able to package successfully and see banner and interstitials in the game. (using the old working plugin)

ritamsarmah commented 1 year ago

Ah I think I found the reason why this issue happens. This seems to be because I compiled the latest version of the plugin with Xcode 14—which introduced those msgSend selector stubs and apparently prevents linking to the static framework with versions of Xcode 13 or lower. (Also why I probably couldn't reproduce this on my machine).

Could you see if upgrading to Xcode 14 fixes the issue? In the meantime, I'll look deeper into this and see whether maintaining compatibility with older Xcode is possible while we compile the plugin with the latest Xcode.

ritamsarmah commented 1 year ago

Hi @awsproserve, I was able to reproduce the errors you were seeing by switching to Xcode 13. I've added a re-compiled version of the framework in the same fix branch that should be compatible with Xcode 13 if you'd like to give it a try.

awsproserve commented 1 year ago

my apologies for the late folllow up, I've been traveling and hadn't got to it until today, Everything works PERFECT! YAY Thank you, thank you thank you! I implemented the banner example you gave me and it works. im now working on testing fail node for banner and implementing interstitial. will keep you updated on my further testing :)

awsproserve commented 1 year ago

Question, do we implement the interstitial ad code in the same AppLovinMaxDelegate code we have the banners in? in the blueprint below:

image
awsproserve commented 1 year ago

also would this be the right code to implement a retry to create and load banner when the original create and load banner fails?

image

ritamsarmah commented 1 year ago

Question, do we implement the interstitial ad code in the same AppLovinMaxDelegate code we have the banners in?

You could, though it's really up to you and the needs of your game if you want a new actor blueprint for separating out your interstitial logic. Here's a screenshot example you may use as reference for loading/showing an interstitial (including retries on fail with exponential delay):

Screen Shot 2022-12-19 at 1 50 58 PM

also would this be the right code to implement a retry to create and load banner when the original create and load banner fails?

Hmm, couple things we'd want to fix there:

  1. Are you using the logic in the second screenshot as well as the Bp_AppLovinMAXDelegate code? You only need to have one or the other, since they're both ways to bind to the events and create the banner.
  2. We also wouldn't want to have Bind Event to... the On Sdk Initialized and On Banner Ad Loaded events twice. The "Bind Event.." nodes connected with the white lines don't indicate chronological execution order; instead, the important part is the logic coming off the red "Event" box which says: "Here is the logic I want to be triggered every time the corresponding event occurs" (again this is equivalent to the method used in Bp_AppLovinMAXDelegate with those separate red event nodes). The current implementation would result in the logic being executed twice redundantly every time the delegate events are triggered.
  3. Banners already have auto-refresh, so if that is sufficient for your use case, then you don't have to worry about implementing a manual retry.
awsproserve commented 1 year ago

Question, do we implement the interstitial ad code in the same AppLovinMaxDelegate code we have the banners in?

You could, though it's really up to you and the needs of your game if you want a new actor blueprint for separating out your interstitial logic. Here's a screenshot example you may use as reference for loading/showing an interstitial (including retries on fail with exponential delay):

Screen Shot 2022-12-19 at 1 50 58 PM

Thanks so much for your response, question are these custom events that you are creating for the interstitial, I tried creating one but it looks alittle different. different meaning my event says custom event on it, and yours does not. see screenshot below:

purple box shows the custom event I created

image

awsproserve commented 1 year ago

the next screenshot here, shows me looking for the event you created on sdk initialized dynamic delegate. is this the way I should be setting these events up?

image
awsproserve commented 1 year ago

Hmm, couple things we'd want to fix there:

  1. Are you using the logic in the second screenshot as well as the Bp_AppLovinMAXDelegate code? You only need to have one or the other, since they're both ways to bind to the events and create the banner.
  2. We also wouldn't want to have Bind Event to... the On Sdk Initialized and On Banner Ad Loaded events twice. The "Bind Event.." nodes connected with the white lines don't indicate chronological execution order; instead, the important part is the logic coming off the red "Event" box which says: "Here is the logic I want to be triggered every time the corresponding event occurs" (again this is equivalent to the method used in Bp_AppLovinMAXDelegate with those separate red event nodes). The current implementation would result in the logic being executed twice redundantly every time the delegate events are triggered.
  3. Banners already have auto-refresh, so if that is sufficient for your use case, then you don't have to worry about implementing a manual retry.

as for my banner setup, I have a event begin play in my level blueprint "level blueprint called gangfembunny", that calls on an event I have in my global game instance to initialize the plugin.

image

here is the code in my global instance that initializes the plugin

image

after that I have it connected to the add applovin max delegate as seen in the screenshot below

image

this is screenshot inside the applovin max delegate

image

then I have all the binding stuff connected to the applovin max delegate

image

is this the correct setup, as this was the setup that you originally prescribed to me as seen in the screenshot of your recommendations below: I just want to make sure im understanding this correctly. many thanks in advance for all your help.

image

ritamsarmah commented 1 year ago

Thanks so much for your response, question are these custom events that you are creating for the interstitial, I tried creating one but it looks alittle different. different meaning my event says custom event on it, and yours does not. see screenshot below:

Not sure if there's a functional difference, but as long as you get it to work that's fine! If you're looking for the exact way I did it, I clicked on "AppLovinMAXDelegate" component in the left side and it shows all the events under "Details" on the right. You can click the green "+" button next to the event name to bind to it.

Screen Shot 2022-12-21 at 9 06 45 AM

is this the correct setup, as this was the setup that you originally prescribed to me as seen in the screenshot of your recommendations below: I just want to make sure im understanding this correctly. many thanks in advance for all your help.

The setup you have in your level blueprint seems good to me; however, you won't even need the Bp_AppLovinMAXDelegate in that case since it's just a different way to do the same thing. They're both implementing the same logic for creating a banner as you can see, so you only need to select one method that suits your needs.

awsproserve commented 1 year ago

Thanks so much, this was very helpful, I was able to set it up just as you did. the way I was doing was not right with custom event method.

One last questions.

so is this correct, that now that I have the interstitial delegate BP setup, so now all I have to do is spawn that delegate actor, and it will listen when I call show interstitial from another level?

So what im going to do is in my main menu, (called gangfembunny) I will call an event from my global instance as seen in the screenshot below to spawn the actor for the interstitial delegate image

Then later on in another level I will call show interstitial. Is that the correct setup? or do I have to spawn the interstitial delegate in the same level that I'll be showing the interstitial ad?

awsproserve commented 1 year ago

also what delegates would I use in the screenshot below if:

User clicks the x during the interstitial ad and exits Interstitial ad plays out and ends without user clicking the add. ie it naturally exits

The reason is because after the interstitial ad is done, I want to have it restart the level. So wanting to see which I should call on.

image

awsproserve commented 1 year ago

I just packaged app and tested it, it looks like when I implement this code in screenshot below, the interstitial ad looks like it only loads one time, and thats when I initially spawn the blueprint in my main menu, then the player goes into level 1 and dies and then calls to show the ad. and it shows. but then when the player dies again it doesn't show the ad any more, ie its not loading another ad after the initial show of the ad.

image
awsproserve commented 1 year ago

I added the two delegates below in the box, so the interstitial can reload after being displayed or clicked and its still not reloading

image

ritamsarmah commented 1 year ago

Your approach sounds good so far, though you shouldn't be loading after "On Interstitial Clicked" and "On Interstitial Displayed"—adding the load after "On Interstitial Hidden" is sufficient.

I'd suggest checking the device logs or adding a log after the events, namely On Interstitial Hidden and On Interstitial Loaded to check if the callback is being invoked or not. Another thing to check is if the next interstitial is not getting loaded in time, by adding a log statement to the False condition after Is Interstitial Ready.

ritamsarmah commented 1 year ago

Hi @awsproserve, just following up on this recent interstitial loading issue to see if you were able to resolve it? If not, we can continue the discussion over email, but I plan on closing this ticket out in any case since the original issue has been addressed.

awsproserve commented 1 year ago

Hi, thanks for following up, Sure thing we can continue discussion over email. I was traveling for the holidays and playing catch up now, I’ll make sure to have this tested by end of week and will report back. Thanks again for everything.

From: Ritam Sarmah @.> Sent: Monday, January 9, 2023 2:38 PM To: AppLovin/AppLovin-MAX-Unreal @.> Cc: Ataiwi, Chad @.>; Mention @.> Subject: Re: [AppLovin/AppLovin-MAX-Unreal] Error while building in unreal engine 4.27 (Issue #13)

Hi @awsproservehttps://github.com/awsproserve, just following up on this recent interstitial loading issue to see if you were able to resolve it? If not, we can continue the discussion over email, but I plan on closing this ticket out in any case since the original issue has been addressed.

— Reply to this email directly, view it on GitHubhttps://github.com/AppLovin/AppLovin-MAX-Unreal/issues/13#issuecomment-1376431170, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3VJ624WO4WGH2DUUN2L43DWRSHMZANCNFSM6AAAAAASFH3RAE. You are receiving this because you were mentioned.Message ID: @.**@.>>

ritamsarmah commented 1 year ago

Sounds great, feel free to email me at ritam.sarmah@applovin.com