-
Notifications
You must be signed in to change notification settings - Fork 507
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
[NET8] Bound external constants on static libraries are being linked as non-external on the final app. #20301
Comments
Just in case someone else sees the same issue and is googling about it, these are signs it is happening:
or an exception is thrown when accessing |
Update to this, the workaround works fine for Adding this extra workaround made the trick for my release builds:
|
This is a duplicate of #20061, which we've already fixed. The fix should be included in the next .NET service release. |
Great analysis of the issue btw! |
Steps to Reproduce
Using NET 8
var adType = Google.MobileAds.AdLoaderAdType.GamBanner.GetConstant()
anywhere in code and run.Expected Behavior
Google.MobileAds.AdLoaderAdType.GamBanner.GetConstant()
should return a valid string.Actual Behavior
null
is returnedEnvironment
dotnet --version 8.0.201
running on macOS 14.3.1 (23D60)
Xcode Version 15.3 (15E204a)
The Cause
external
constants in the static library (contained in a xcframework) are being imported asnon-external
on the final app.GoogleMobileAds.xcframework
![Screenshot 2024-03-13 at 12 35 40](https://private-user-images.githubusercontent.com/7071748/312523906-dbc173c4-ef9d-4f71-ac76-1f11f0e745f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4OTIxMjksIm5iZiI6MTcyNTg5MTgyOSwicGF0aCI6Ii83MDcxNzQ4LzMxMjUyMzkwNi1kYmMxNzNjNC1lZjlkLTRmNzEtYWM3Ni0xZjExZjBlNzQ1ZjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhd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O59_Yunw1eX08ALxD8-TwIU)
This is the relevant binding: https://github.com/xamarin/GoogleApisForiOSComponents/blob/c7ae591364f73a4e61d47d765a1e537bb509422e/source/Google/MobileAds/Enums.cs#L28
Last Version it was Working?
I don't know for certain. I jumped from Xamarin.iOS straight to NET8
Example Project
linking_error.zip
Workaround
-exported_symbols_list my_list.list
My App with workaround
![Screenshot 2024-03-13 at 12 36 37](https://private-user-images.githubusercontent.com/7071748/312524262-84a6a9ac-e0da-4839-ac0f-6e58cac9bed1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4OTIxMjksIm5iZiI6MTcyNTg5MTgyOSwicGF0aCI6Ii83MDcxNzQ4LzMxMjUyNDI2Mi04NGE2YTlhYy1lMGRhLTQ4MzktYWMwZi02ZTU4Y2FjOWJlZDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDlUMTQyMzQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDMwMDE0MWMwMDE1MDEzMWFlMDI1Mzg3MGNlZDk5NGZjMWE1MmE2MmYxYWVkMzA2NjBjNWIxZGM1ODM3NzViMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.F0mOsGbYY-esNTN1dh4T273GeZ1Nc108TKOewQ8CxKQ)
Sample project with workaround implemented
linking_error_workaround.zip
The text was updated successfully, but these errors were encountered: