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

crash on startup library not loaded #3515

Open
RomainBitard opened this issue Aug 12, 2024 · 10 comments
Open

crash on startup library not loaded #3515

RomainBitard opened this issue Aug 12, 2024 · 10 comments

Comments

@RomainBitard
Copy link

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2022.3.17f1
  • Google Mobile Ads Unity plugin version: 9.2.0
  • Plugin installation method: .unitypackage import
  • Platform: iOS
  • Platform OS version: n/a
  • Any specific devices issue occurs on: _____
  • Mediation ad networks used, and their versions: applovin latest or 7.3.1

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

When I add applovin and build the app crash on startup, it works without any adapter

2024-08-12 11:09:38.046306+0200 crapette[715:18860] Error loading /var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/UnityFramework.framework/UnityFramework:  dlopen(/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: '@rpath/AppLovinSDK.framework/AppLovinSDK'
  Referenced from: '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/UnityFramework.framework/UnityFramework'
  Reason: tried: '/usr/lib/swift/AppLovinSDK.framework/AppLovinSDK' (no such file), '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file), '/usr/lib/swift/AppLovinSDK.framework/AppLovinSDK' (no such file), '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file), '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file), '/System/Library/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file)
2024-08-12 11:09:38.048903+0200 crapette[715:18860] Error loading /var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/UnityFramework.framework/UnityFramework:  dlopen(/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: '@rpath/AppLovinSDK.framework/AppLovinSDK'
  Referenced from: '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/UnityFramework.framework/UnityFramework'
  Reason: tried: '/usr/lib/swift/AppLovinSDK.framework/AppLovinSDK' (no such file), '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file), '/usr/lib/swift/AppLovinSDK.framework/AppLovinSDK' (no such file), '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file), '/private/var/containers/Bundle/Application/9529AEE7-3187-4461-9613-C8A10238E4A3/crapette.app/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file), '/System/Library/Frameworks/AppLovinSDK.framework/AppLovinSDK' (no such file)
@RomainBitard
Copy link
Author

Tried the same process with unity, it works

@RomainBitard
Copy link
Author

I'll try a lower version of applovin adapter

@RomainBitard
Copy link
Author

same problem Library not loaded: '@rpath/AppLovinSDK.framework/AppLovinSDK

each time I update admob I have tons of issues, admob sdk is f****ng TRASH

@RomainBitard
Copy link
Author

RomainBitard commented Aug 12, 2024

I have to find the xcframework file and manually copy it with a postprocessbuild ... basically I have to do your job to make it work . it's amazing. I'll probably switch to a competitor soon I can't lose my time like this every update

using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
namespace unscripted._Scripts.Editor {
    public class ApplovinTMP
    {

        [PostProcessBuild]
        public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
        {
            if (target == BuildTarget.iOS)
            {
                string projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
                PBXProject proj = new PBXProject();
                proj.ReadFromFile(projPath);

                string mainTargetGuid = proj.GetUnityMainTargetGuid();

                // Adding xcframework
                string xcFrameworkPath = "Pods/GoogleMobileAdsMediationAppLovin/AppLovinAdapter-12.4.0.0/AppLovinAdapter.xcframework";
                string fileGuid = proj.AddFile(xcFrameworkPath, xcFrameworkPath, PBXSourceTree.Source);
                proj.AddFileToBuild(mainTargetGuid, fileGuid);

                // Ensure frameworks are embedded properly
                string embedFrameworksBuildPhase = proj.GetFrameworksBuildPhaseByTarget(mainTargetGuid);
                proj.AddFileToBuildSection(mainTargetGuid, embedFrameworksBuildPhase, fileGuid);

                proj.SetBuildProperty(mainTargetGuid, "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks");

                proj.WriteToFile(projPath);
            }
        }
    }
}

@RomainBitard
Copy link
Author

it doesn't even work on the latest adapter version it works on applovin7.2.0

@RomainBitard
Copy link
Author

I have the same problem with inMobi @NVentimiglia do you know what causes this ?

@RomainBitard
Copy link
Author

The problem is known since a long time already
#3395

@NVentimiglia
Copy link
Member

We are looking into this issue and will get back to you when we have updates.

@NVentimiglia
Copy link
Member

image

for AppLovin you must set the External Dependency Manager > iOS > Settings to use a dynamic linked framework

@RomainBitard
Copy link
Author

You reopened it because it's not a solution I guess ? I checked and it's already set up like this. The only workaround I use is the one I mentioned in this issue

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