Failed to look up symbolic reference at 0x10dc0191f - offset 796625 - symbol symbolic _____Sg 14MarketplaceKit14AppDistributorO in /private/var/folders/zh/ln0rqwm94499jwvk1x_hl5r00000gp/X/XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/d/Wrapper/MyApp.app/Frameworks/UnityFramework.framework/UnityFramework
I used thepostin the 'EDIT 2' to come up with a decent solution. I don't know if it will work 100% of the time and I would love for someone to correct me if I have chosen a poor solution. This should allow me to run code before the build starts, and if the build fails or succeeds without changing the unity build pipeline.
class CustomBuildPipeline : MonoBehaviour, IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
public int callbackOrder => 0;
// CALLED BEFORE THE BUILD
public void OnPreprocessBuild(BuildReport report)
{
// Start listening for errors when build starts
Application.logMessageReceived += OnBuildError;
}
// CALLED DURING BUILD TO CHECK FOR ERRORS
private void OnBuildError(string condition, string stacktrace, LogType type)
{
if (type == LogType.Error)
{
// FAILED TO BUILD, STOP LISTENING FOR ERRORS
Application.logMessageReceived -= OnBuildError;
}
}
// CALLED AFTER THE BUILD
public void OnPostprocessBuild(BuildReport report)
{
// IF BUILD FINISHED AND SUCCEEDED, STOP LOOKING FOR ERRORS
Application.logMessageReceived -= OnBuildError;
}
}
With recent Unity versions (2020, 2021 and 2022) Flutter Android builds will take a lot longer, because it also has to compile the IL2CPP code from Unity.
From the Readme:
Android builds takes forever to complete Unity 2022.1.*, remove these lines from unityLibrary/build.gradle filecommandLineArgs.add("--enable-debugger") commandLineArgs.add("--profiler-report") commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_conv.traceevents")
Here is some testing to check how to speed things up.
Or C#EditorUserBuildSettings.il2CppCodeGeneration = UnityEditor.Build.Il2CppCodeGeneration.OptimizeSize;
C++ compiler configuration
InPlayer settings -> Other settings -> configuration, selectDebug.
Or C#PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.Android, Il2CppCompilerConfiguration.Debug);
Disable script debugging
Don't bother setting this in the Unity settings, it will be overridden by the build script. Assets/FlutterUnityIntegration/Editor/build.cs In the functionDoBuildAndroid()remove the line enabling script debugging. playerOptions.options = BuildOptions.AllowDebugging; This is the same as removingcommandLineArgs.add("--enable-debugger")from the build.gradle file after an export.
Measuring results
When you run a Flutter build, there are multiple IL2CPP stages that report their duration, with 2 sections taking far longer than all others. We can compare these build durations when using different settings in Unity.
The exact durations here aren't important, as this will be different of every computer and project setup. This is afterflutter cleanand a fresh Unity export. Any subsequent runs will be faster because of caching.
Flutter build apk, with an export from Unity 2021.3.5f1 inandroid/unityLibraryon Windows 10.
Settingarmv7 durationarm64 duration
example project
2m:04s
2m:03s
1 - Code generation (faster builds)
1m:41s
1m:38s
2 - Compiler configuration (debug)
45s
43s
3 - No script debugging
30s
30s
1 + 2
35s
34s
1 + 2 + 3
23s
25s
Conclusion
My advice is to add this to the build script inDoBuildAndroid()for any test or debug builds, remove it for final release builds.
pod install output:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
In Podfile:
Firebase/Auth (= 10.6.0) was resolved to 10.6.0, which depends on
FirebaseAuth (~> 10.6.0) was resolved to 10.6.0, which depends on
GTMSessionFetcher/Core (< 4.0, >= 2.1)
GoogleSignIn (= 6.0.2) was resolved to 6.0.2, which depends on
GTMAppAuth (~> 1.0) was resolved to 1.3.1, which depends on
GTMSessionFetcher/Core (< 3.0, >= 1.5)
GoogleSignIn (= 6.0.2) was resolved to 6.0.2, which depends on
GTMSessionFetcher/Core (~> 1.1)
Firebase 10.6.0이 업데이트 돼서 다시 한 번 iOS 빌드를 시도해 봤는데 여전히 에러가 난다.
UnayOzan commented on Feb 5
Fixed this error with changing the version in "GoogleSignIn.podspec.json" file.
Firebase/Auth (= 10.4.0) was resolved to 10.4.0, which depends on
FirebaseAuth (~> 10.4.0) was resolved to 10.4.0, which depends on
GTMSessionFetcher/Core (< 4.0, >= 2.1)
GoogleSignIn (~> **5.0.2**) was resolved to **5.0.2**, which depends on
GTMSessionFetcher/Core (~> **1.1**)
I found the file in {user}.cocoapods/repos/cocoapods/Specs and then just search for "GoogleSignIn.podspec.json".
Find the folder with the same version with the error, in my case 5.0.2.
And then change its dependencies with the version 7.0.0 or something that works with the other packages.
In my project the solution was this;
"dependencies": {
"AppAuth": [
"~> 1.5"
],
"GTMAppAuth": [
">= 1.3",
"< 3.0"
],
"GTMSessionFetcher/Core": [
">= 1.1",
"< 4.0"
]
After that I exited Xcode, deintagrated pods, cleaned cache and installed it again.
Everything works fine now.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key anne from store
"C:\Test_Unity2022\Keystore\testapp.keystore": Cannot recover key
Unity 2022 포팅 테스트 해볼 겸 올려보다가 빌드 에러가 나서 보니 위와 같은 에러가 뜨고 있다.