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

FBAudienceNetwork.framework has an invalid CFBundleIdentifier #2491

Open
5 tasks done
SzGajdzica opened this issue Oct 14, 2024 · 20 comments
Open
5 tasks done

FBAudienceNetwork.framework has an invalid CFBundleIdentifier #2491

SzGajdzica opened this issue Oct 14, 2024 · 20 comments

Comments

@SzGajdzica
Copy link

Checklist before submitting a bug report

Xcode version

16.0

Facebook iOS SDK version

iOS Audience Network SDK 6.15.2

Dependency Manager

SPM

SDK Framework

Other / I don't know

Goals

I want to add FBAudienceNetwork to my project

Expected results

I want to add FBAudienceNetwork to my project

Actual results

Asset validation failed
This bundle is invalid. The bundle at path Payload/my-gps-location-ios.app/Frameworks/FBAudienceNetwork.framework has an invalid CFBundleIdentifier '$(PRODUCT_BUNDLE_IDENTIFIER)' There are invalid characters(characters that are not dots, hyphen and alphanumerics) that have been replaced with their code point '\u0024\u0028PRODUCT\u005fBUNDLE\u005fIDENTIFIER\u0029' CFBundleIdentifier must be present, must contain only alphanumerics, dots, hyphens and must not end with a dot. [see the Core Foundation Keys at https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102070-TPXREF105] (ID: 51b6234b-3664-4f70-b53d-219d14706a34)

Steps to reproduce

Add xcframework downloaded from here https://developers.facebook.com/docs/audience-network/setting-up/platform-setup/ios/add-sdk/

Code samples & details

No response

@cheebow
Copy link

cheebow commented Oct 16, 2024

I am having the same problem with iOS Audience Network SDK 6.16.0

@huangwenjing12
Copy link

Hi, have you solved this problem?

@SzGajdzica
Copy link
Author

Nope, i've made some progress with Admob mediations adapters https://groups.google.com/g/google-admob-ads-sdk/c/-7N5D2Yq1cI, but Facebook will take half a year to year to fix

@bengus
Copy link

bengus commented Dec 26, 2024

The problem is still active. Last version which is working okay is 6.15.1

@jesphinpt
Copy link

I am facing this error with 6.16.0. Any workarounds?
Screenshot-2024-12-30-at-8-18-53-PM-12-30-2024_08_20_PM
Screenshot-2024-12-30-at-8-18-59-PM-12-30-2024_08_19_PM

@huangwenjing12
Copy link

huangwenjing12 commented Jan 3, 2025 via email

@huangwenjing12
Copy link

huangwenjing12 commented Jan 3, 2025 via email

@jesphinpt
Copy link

But 6.15.1 also not solve the upload error, If I add embed and sign in the manual integration and it failing with archive. Also If I remove embed and sign, it crashing while opening the app
Screenshot 2025-01-03 at 2 48 14 PM

@huangwenjing12
Copy link

huangwenjing12 commented Jan 3, 2025 via email

@jesphinpt
Copy link

Getting duplicate error
Screenshot 2025-01-03 at 3 15 20 PM

@huangwenjing12
Copy link

huangwenjing12 commented Jan 3, 2025 via email

@jesphinpt
Copy link

Did you add the xcframework in the Embed Frameworks?

I have added in the Embed Frameworks

Also If I add in the Copy files it shows the duplicate error.

@huangwenjing12
Copy link

huangwenjing12 commented Jan 3, 2025 via email

@kvenn
Copy link

kvenn commented Jan 15, 2025

I'm also having this issue. I added the project through the Package.swift file. It works and builds fine locally, but fails when deploying to the app store.

Package.swift

let package = Package(
    name: "...",
    platforms: [.macOS(.v12), .iOS(.v15)],
    products: [
        ...
    ],
    dependencies: [
		....
    ],
    targets: [
        .target(
            name: "..",
            dependencies: [
				...
            ]
        ),
        .target(
            name: "..",
            dependencies: [
                // Ads - Mintegral
                .product(name: "MintegralAdSDK", package: "MintegralAdSDK-Swift-Package"),
                .target(name: "MintegralAdapter"),
                // Ads - AppLovin
                .product(name: "AppLovinSDK", package: "AppLovin-MAX-Swift-Package"),
                .target(name: "AppLovinAdapter"),
                // Ads - FB Audience Network
                .target(name: "FBAudienceNetwork"),
                .target(name: "MetaAdapter"),
...

        // Ads - FB Audience Network
        .binaryTarget(
            name: "FBAudienceNetwork",
            path: "XCFrameworks/FBAudienceNetwork.xcframework"
        ),
        .binaryTarget(
            name: "MetaAdapter",
            path: "XCFrameworks/MetaAdapter.xcframework"
        ),

Error

[!] Error uploading ipa file: 
 [Application Loader Error Output]: [ContentDelivery.Uploader.600001D041C0] Asset validation failed (90049) This bundle is invalid. The bundle at path Payload/app.app/Frameworks/FBAudienceNetwork.framework has an invalid CFBundleIdentifier '$(PRODUCT_BUNDLE_IDENTIFIER)' There are invalid characters(characters that are not dots, hyphen and alphanumerics) that have been replaced with their code point '\u0024\u0028PRODUCT\u005fBUNDLE\u005fIDENTIFIER\u0029' CFBundleIdentifier must be present, must contain only alphanumerics, dots, hyphens and must not end with a dot. [see the Core Foundation Keys at 

@kvenn
Copy link

kvenn commented Jan 15, 2025

Okay this isn't the place to be talking about this (I now know). There is an issue in the right place here: https://developers.facebook.com/community/threads/1535870873800781/

But yeah I think I figured it out.

Modify the info.plist here in FBAudienceNetwork.xcframework->ios-arm64->FBAudienceNetwork.framework->Info.plist

	<key>CFBundleIdentifier</key>
    <string>com.facebook.FBAudienceNetwork</string>
    <key>CFBundleVersion</key>
    <string>6.16.0</string>

Then, since you modified the framework, you'll need to re-sign it

# This will get the Apple Development string you need to paste below (where I have 'example')
security find-identity -p codesigning -v
# Final argument is the path to the actual xcframework you're using in your project
codesign -f -s "Apple Development: Example (Example)" --timestamp --deep "XCFrameworks/FBAudienceNetwork.xcframework"

I found the bundle id from 6.12.0. And took a guess on the bundle version.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>FBAudienceNetwork</string>
    <key>CFBundleIdentifier</key>
    <string>com.facebook.FBAudienceNetwork</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>FBAudienceNetwork</string>
    <key>CFBundlePackageType</key>
    <string>FMWK</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
        <string>iPhoneOS</string>
    </array>
    <key>CFBundleVersion</key>
    <string>6.5.1</string>
    <key>DTPlatformBuild</key>
    <string>19F64</string>
    <key>DTPlatformName</key>
    <string>iphoneos</string>
    <key>DTPlatformVersion</key>
    <string>15.5</string>
    <key>DTSDKBuild</key>
    <string>19F64</string>
    <key>DTSDKName</key>
    <string>iphoneos15.5</string>
    <key>DTXcode</key>
    <string>1340</string>
    <key>DTXcodeBuild</key>
    <string>13F17a</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>10.0</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2014 Facebook. All rights reserved.</string>
</dict>
</plist>

@mmkhandan1
Copy link

Okay this isn't the place to be talking about this (I now know). There is an issue in the right place here: https://developers.facebook.com/community/threads/1535870873800781/

But yeah I think I figured it out.

Modify the info.plist here in FBAudienceNetwork.xcframework->ios-arm64->FBAudienceNetwork.framework->Info.plist

	<key>CFBundleIdentifier</key>
    <string>com.facebook.FBAudienceNetwork</string>
    <key>CFBundleVersion</key>
    <string>6.16.0</string>

Then, since you modified the framework, you'll need to re-sign it

# This will get the Apple Development string you need to paste below (where I have 'example')
security find-identity -p codesigning -v
# Final argument is the path to the actual xcframework you're using in your project
codesign -f -s "Apple Development: Example (Example)" --timestamp --deep "XCFrameworks/FBAudienceNetwork.xcframework"

I found the bundle id from 6.12.0. And took a guess on the bundle version.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>FBAudienceNetwork</string>
    <key>CFBundleIdentifier</key>
    <string>com.facebook.FBAudienceNetwork</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>FBAudienceNetwork</string>
    <key>CFBundlePackageType</key>
    <string>FMWK</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
        <string>iPhoneOS</string>
    </array>
    <key>CFBundleVersion</key>
    <string>6.5.1</string>
    <key>DTPlatformBuild</key>
    <string>19F64</string>
    <key>DTPlatformName</key>
    <string>iphoneos</string>
    <key>DTPlatformVersion</key>
    <string>15.5</string>
    <key>DTSDKBuild</key>
    <string>19F64</string>
    <key>DTSDKName</key>
    <string>iphoneos15.5</string>
    <key>DTXcode</key>
    <string>1340</string>
    <key>DTXcodeBuild</key>
    <string>13F17a</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>10.0</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2014 Facebook. All rights reserved.</string>
</dict>
</plist>

This worked for me! Thank you so so much for sharing your solution. You're awesome!

@mmkhandan1
Copy link

@kvenn Your solution worked for me! Thank you so so much for sharing your solution. You're awesome!

@SzGajdzica
Copy link
Author

Hi, I am still having issues with that. I am trying to create a swift package that contains this xcframework. I am getting error
alrqxkskvghvneealbqqnguumyep/Build/Products/Debug-iphoneos/FBAudienceNetwork.framework/FBAudienceNetwork'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anyone has a working swift package containg this library?

@kvenn
Copy link

kvenn commented Jan 27, 2025

Mine is working and I didn't do much else custom (other than the comment I included). But some other things to try:

  • All the steps from "notes" as well as "troubleshooting" (I'm using static, and swift embed checked)
  • Enable the -ObjC flag in Xcode: click on your project settings, go to Build Settings, search for Other Linker Flags and add -ObjC

And finally, you can do file->packages->refresh or rebuild (or whatever it's called). With a clean. Sometimes it's just a random xcode thing. And if all else fails, restarting your computer can't hurt.

@SzGajdzica
Copy link
Author

SzGajdzica commented Jan 28, 2025

I am using it in many small projects and i am trying include it in the swift pacakge so it is eaasier to add it to any project i want. It would be best to add it to the swift pacakge but still i am having some issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants