amplitude / amplitude/Amplitude-iOS

Not able to compile example App when Amplitude is added inside Framework

Offen
#244 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Objective-C
Sterne
328
Forks
194
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hello,
I have added Amplitude as a dependent inside my framework.
To add the framework, I built the sample project and copied`Amplitude_iOS.framework` (amplitude-ios/4.9.3) from there. The framework builds and runs perfectly fine.

However, when I try to build my sample App with this `umbrella framework`, I get an error something like below.

```
dyld: Library not loaded: @rpath/Amplitude_iOS.framework/Amplitude_iOS
Referenced from: /private/var/containers/Bundle/Application/EE3EB4B0-5E27-4D4B-8538-402777B8A15C/Livesense.app/Frameworks/LiveSenseDetection.framework/LiveSenseDetection
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/EE3EB4B0-5E27-4D4B-8538-402777B8A15C/Livesense.app/Frameworks/LiveSenseDetection.framework/Frameworks/Amplitude_iOS.framework/Amplitude_iOS: code signature in (/private/var/containers/Bundle/Application/EE3EB4B0-5E27-4D4B-8538-402777B8A15C/Livesense.app/Frameworks/LiveSenseDetection.framework/Frameworks/Amplitude_iOS.framework/Amplitude_iOS) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
```

For resolve, I did the following :
1. Enabled `copy files` in framework as it can be seen below
Screenshot 2020-04-27 at 5 57 23 PM
2. Added the below script in my same App :

```
pushd ${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Frameworks/XXX.framework/Frameworks
for EACH in *.framework; do
echo "-- signing ${EACH}"
/usr/bin/codesign --force --deep --sign "${EXPANDED_CODE_SIGN_IDENTITY}" --entitlements "${TARGET_TEMP_DIR}/${PRODUCT_NAME}.app.xcent" --timestamp=none $EACH
done
popd
```
Similar to something mentioned here
https://medium.com/@bittudavis/how-to-create-an-umbrella-framework-in-swift-ca964d0a2345

Now, when I build the App on the device with this `Umbrella framework`, I get an error saying
`"Missing required modules Amplitude_iOS"`

Apparently, this whole setup runs fine on Xcode < 11. I presume some Xcode related settings are causing an issue here.

It would be great if anyone could provide input on this or share a better approach to resolve it.

Thanks in advance

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.