firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
220 stars 35 forks source link

[Bug] #432

Closed vwormsbecherJC closed 2 years ago

vwormsbecherJC commented 2 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

Everything started with AdMob update and its Mediators, which usually involves Firebase update too. Right after AdMob update - iOS build still produced file (although app was crashing right on start) so attempted to update Firebase to 9.0.0 or later, but now can't get iOS to build... Had some issues with Android too, but updating gradle (was used custom one before as project drags from unity 2019, just replaced with unity included now) and bumping minSDK version to 31 everything builds and plays with no issues there. Still iOS just won't build - updated xCode to 13.3.1 now can't get the build to work, and as android build works, it seems I'm missing some build configuration or smth - what are recommended options for IOSResolver? these are settings that are in use now... and failing

            Google.IOSResolver.PodfileGenerationEnabled = true;
            Google.IOSResolver.CocoapodsIntegrationMethodPref = Google.IOSResolver.CocoapodsIntegrationMethod.Project;
            Google.IOSResolver.PodToolExecutionViaShellEnabled = true;
            Google.IOSResolver.AutoPodToolInstallInEditorEnabled = true;
            Google.IOSResolver.VerboseLoggingEnabled = false;
            Google.IOSResolver.UseProjectSettings = true;
            Google.IOSResolver.PodfileAddUseFrameworks = true;
            Google.IOSResolver.PodfileAllowPodsInMultipleTargets = true;
            Google.IOSResolver.PodfileAlwaysAddMainTarget = true;
            Google.IOSResolver.PodfileStaticLinkFrameworks = true;
            Google.IOSResolver.SwiftFrameworkSupportWorkaroundEnabled = true;
            Google.IOSResolver.SwiftLanguageVersion = "5.0";
            Google.IOSResolver.PodToolShellExecutionSetLang = true;

and before update was used

            Google.IOSResolver.PodfileGenerationEnabled = true;
            Google.IOSResolver.CocoapodsIntegrationMethodPref = Google.IOSResolver.CocoapodsIntegrationMethod.Project;
            Google.IOSResolver.PodToolExecutionViaShellEnabled = true;
            Google.IOSResolver.AutoPodToolInstallInEditorEnabled = true;
            Google.IOSResolver.VerboseLoggingEnabled = false;
            Google.IOSResolver.UseProjectSettings = true;
            Google.IOSResolver.PodfileAddUseFrameworks = false;
            Google.IOSResolver.PodfileAllowPodsInMultipleTargets = true;
            Google.IOSResolver.PodfileAlwaysAddMainTarget = false;
            Google.IOSResolver.PodfileStaticLinkFrameworks = false;

right after update was having these on buildmachine logs: The Swift podFirebaseCoreInternaldepends uponGoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may setuse_modular_headers!globally in your Podfile, or specify:modular_headers => truefor particular dependencies.

so tried to add manually <iosPod name="GoogleUtilities" version="7.7.0" modular_headers="true">

but although pods were installed, that was causing more issues down the line (on every imported firebase package)

FirebaseCore/Extension/FirebaseCoreInternal.h:15:9: fatal error: module 'FirebaseCore' not found
@import FirebaseCore;

so after xCode update, adding static links and swift framework pods do install, now having these errors on build for every referenced pod: Build_iOS/Pods/___.entitlements" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target "___" is correct and that the file exists on disk. (in target '___' from project 'Pods')

whole thing is that entitlements are correct and placed on root Build_iOS folder, not within Pods - I'm not familiar with such referencing and even tried to manually copy file there, but it didn't helped

Feels like I'm missing something obvious, but can't figure it out yet

google-oss-bot commented 2 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

paulinon commented 2 years ago

Hi @vwormsbecherJC,

Based on the information you provided, it appears that Xcode project is selected for your Cocoapods integration rather than Xcode workspace. Could you try changing this setting and see if the issue persists? If it does, please provide a minimal, reproducible example of your implementation so that we could identify what's causing the issue.

vwormsbecherJC commented 2 years ago

switched to CocoapodsIntegrationMethod.Workspace but that resulted in Plugins/iOS/VungleExtrasBuilder.h:5:9: fatal error: 'GoogleMobileAds/GoogleMobileAds.h' file not found only indicating some pods import issue, what does this setting affecting exactly? never used it before and had no issues with any firebase pre 9.0.0 (upgrading from 8.6.2)

paulinon commented 2 years ago

Hi @vwormsbecherJC,

Typically, the .xcworkspace file is used to build the app including the Firebase SDK. Given that changing the setting didn't resolve the issue, it would be helpful if you share a minimal, reproducible example of your implementation so that we could analyze this behavior.

vwormsbecherJC commented 2 years ago

@paulinon After a bit of investigation we've discovered that the issue is coming from our command line build parameters and xcode process breaks after update to version 9 (currently trying to get 9.3 working) on our build command we do use PROVISIONING_PROFILE_SPECIFIER and CODE_SIGN_ENTITLEMENTS values, and removing them from command and providing manually those parameters through xcode fixed the archive creation, but still automation with this update fails. Building on a version just without firebase update succeeds on very same updated xcode 13.3.1

paulinon commented 2 years ago

Hi @vwormsbecherJC,

While waiting to see if SDK version 9.3.0 makes a difference, could you provide the following information:

vwormsbecherJC commented 2 years ago

Hi @paulinon Having an update: all my issues were because of the use_framwworks! key By default it wasn't used (was stripped in postbuild) and after the update showed that GoogleUtilities dependency issue. After enabling it started to show that issue with the build command parameters mentioned in previous message. And on initial report I was really close to solution, which is to include both pods with modular headers in addition to pod 'Firebase/Core', '9.3.0' also

  pod 'FirebaseCore', :modular_headers => true 
  pod 'GoogleUtilities', :modular_headers => true

now it builds again

paulinon commented 2 years ago

Glad to hear that you're able to build your app again, @vwormsbecherJC.

I'll be closing this for now. Let me know if an issue arises.