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

Unable to install app on device when adding FirebaseAnalyticsOnDeviceConversion via SPM #10126

Closed
gbrixey opened this issue Aug 22, 2022 · 7 comments

Comments

@gbrixey
Copy link

gbrixey commented Aug 22, 2022

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.4.1 (13F100)
  • Firebase SDK version: 9.4.1
  • Installation method: Swift Package Manager
  • Firebase Component: FirebaseAnalyticsOnDeviceConversion
  • Target platform(s): iOS

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

  • Integrate Firebase into the app using Swift Package Manager.
  • Add FirebaseAnalyticsOnDeviceConversion to the app target.
  • Run the app on a connected device.
  • Xcode will fail to install the app on device, and will present an error message similar to the following:
Unable to install "(App Name)"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
    DVTErrorCreationDateKey = "2022-08-22 18:17:24 +0000";
    IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}
--
The code signature version is no longer supported.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
...

See the full text of the error message here.

This error only appears when running the app on a physical device; there is no such error when running on simulator.

This issue is similar to another one that was reported and closed recently: #9938. The repro steps are slightly different for me, as I am using SPM and I am not attempting to embed FirebaseAnalyticsOnDeviceConversion. The Firebase SDK version is also different.

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@paulb777
Copy link
Member

Thanks for the report. It's being tracked internally at b/242914978

@morganchen12
Copy link
Contributor

@gbrixey can you share your project? We suspect this issue occurs when SPM links a static dependency into your app target and then extraneously bundles it into your app bundle as well. The bundled library is unsigned, which causes errors when deploying to device (unsigned bundles can run fine on simulator).

@gbrixey
Copy link
Author

gbrixey commented Aug 23, 2022

@morganchen12 sure, I was able to reproduce the issue with a simple test project: FirebaseSPMTest.zip

@morganchen12
Copy link
Contributor

Thanks @gbrixey, the culprit seems to be GoogleAppMeasurementOnDeviceConversion, which is copied into the app bundle during the Build target FirebaseSPMTest stage of the build process:

Copy /Users/morganchen/Library/Developer/Xcode/DerivedData/FirebaseSPMTest-fyqgnspyuddtyjarwmojoxsoezpw/Build/Products/Debug-iphonesimulator/FirebaseSPMTest.app/Frameworks/GoogleAppMeasurementOnDeviceConversion.framework /Users/morganchen/Library/Developer/Xcode/DerivedData/FirebaseSPMTest-fyqgnspyuddtyjarwmojoxsoezpw/SourcePackages/artifacts/GoogleAppMeasurement/GoogleAppMeasurementOnDeviceConversion.xcframework/ios-arm64_i386_x86_64-simulator/GoogleAppMeasurementOnDeviceConversion.framework (in target 'FirebaseSPMTest' from project 'FirebaseSPMTest')
    cd /Users/morganchen/Downloads/FirebaseSPMTest
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude \*.tbd -resolve-src-symlinks /Users/morganchen/Library/Developer/Xcode/DerivedData/FirebaseSPMTest-fyqgnspyuddtyjarwmojoxsoezpw/SourcePackages/artifacts/GoogleAppMeasurement/GoogleAppMeasurementOnDeviceConversion.xcframework/ios-arm64_i386_x86_64-simulator/GoogleAppMeasurementOnDeviceConversion.framework /Users/morganchen/Library/Developer/Xcode/DerivedData/FirebaseSPMTest-fyqgnspyuddtyjarwmojoxsoezpw/Build/Products/Debug-iphonesimulator/FirebaseSPMTest.app/Frameworks

I haven't figured out how to remove this copy command without excluding FirebaseAnalyticsOnDeviceConversion from the binary entirely, but in the short term you can test if this is the source of your build error by removing the framework from your app bundle, re-signing it, and then trying to install it to a device.

@morganchen12
Copy link
Contributor

@htcgh and the Analytics team have identified a fix. I tested a prerelease binary with your test project and it built successfully. We should have this out in the next release.

@morganchen12 morganchen12 added this to the 9.6.0 - M121 milestone Sep 1, 2022
@paulb777
Copy link
Member

Should be fixed in 9.6.0 that released today.

@firebase firebase locked and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants