BarcodeScanner.Mobile
BarcodeScanner.Mobile copied to clipboard
[iOS] Current MAUI version 8.0.21 not working on iOS
Describe the bug I have been using the 8.0.0.1 version with MAUI on both Android and iOS (both Debug and Release builds) After updating to 8.0.21 Android still works but iOS doesn't build anymore.
StackTrace
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(3,3): Error: clang++ exited with code 1:
Undefined symbols for architecture arm64:
"_GPBClearOneof", referenced from:
_MOBTransform_ClearTransformOneOfCase in MLKitMDD
"_GULLogBasic", referenced from:
_MLKLog in MLKitCommon(MLKLogger.o)
"_OBJC_CLASS_$_GDTCORTransport", referenced from:
objc-class-ref in MLKitCommon(MLKFirelogTransport.o)
"_OBJC_CLASS_$_GPBAny", referenced from:
_descriptor.fields.72 in MLKitMDD
_descriptor.fields.23 in MLKitMDD
_descriptor.fields.87 in MLKitMDD
_descriptor.fields.158 in MLKitMDD
"_OBJC_CLASS_$_GPBCodedOutputStream", referenced from:
objc-class-ref in MLKitCommon(CCTLogOutputStream.o)
"_OBJC_CLASS_$_GPBDescriptor", referenced from:
objc-class-ref in MLKitMDD
objc-class-ref in MLKitCommon(FirebaseMlSdk.pbobjc.o)
objc-class-ref in MLKitCommon(VisionExtension.pbobjc.o)
objc-class-ref in MLKitCommon(Barhopper.pbobjc.o)
objc-class-ref in MLKitCommon(Clientanalytics.pbobjc.o)
objc-class-ref in MLKitCommon(LogContext.pbobjc.o)
System Info:
- I'm trying to build on an Intel based Mac.
- I tried with both VSCode and Visual Studio for Mac
- I'm trying to build/ deploy to a physical iPhone only
- Tried both Debug and Release configs (that worked on previous version)
Additional context
- I tried different Trimming, Runtime, AOT configurations/combinations but none work. (including no Linking/Trimming)
- I'm only trying to build to a physical iPhone. I'm aware emulators don't work.
Workaround Downgraded to version 8.0.0.1 and everything works again.
Same issue
same issue, Workaround Downgraded to version 8.0.0.1 and everything works again. - works for me
Same issue here, but on an M2 Mac
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/targets/Xamarin.Shared.Sdk.targets(3,3): Error: clang++ exited with code 1: Undefined symbols for architecture arm64: "_GPBClearOneof", referenced from: _MOBTransform_ClearTransformOneOfCase in MLKitMDD "_GULLogBasic", referenced from: _MLKLog in MLKitCommon(MLKLogger.o) "OBJC_CLASS$_GDTCORTransport", referenced from: objc-class-ref in MLKitCommon(MLKFirelogTransport.o) "OBJC_CLASS$_GPBAny", referenced from: _descriptor.fields.72 in MLKitMDD _descriptor.fields.23 in MLKitMDD _descriptor.fields.87 in MLKitMDD _descriptor.fields.158 in MLKitMDD "OBJC_CLASS$_GPBCodedOutputStream", referenced from: objc-class-ref in MLKitCommon(CCTLogOutputStream.o) "OBJC_CLASS$_GPBDescriptor", referenced from: objc-class-ref in MLKitMDD objc-class-ref in MLKitCommon(FirebaseMlSdk.pbobjc.o) objc-class-ref in MLKitCommon(VisionExtension.pbobjc.o) objc-class-ref in MLKitCommon(Barhopper.pbobjc.o) objc-class-ref in MLKitCommon(Clientanalytics.pbobjc.o) objc-class-ref in MLKitCommon(LogContext.pbobjc.o) (MLKit.Barcode)
I am facing the same issue. There should be something missing in the csproj that we need to add to prevent the build issue to occur
It seems to be not only iOS. Our builds are not working on Android as well. With 8.0.21 the build is stuck even after half an hour. After the errors on iOS build we tried to roll back to version 8.0.0.1 and it works.
Maybe the android builds will work in Visual Studio, we are working with Rider.
I am noticing that our Visual Studio builds are 'infinitely pausing' recently as well, looks like some strange interaction with the Xamarin.Build.Download package and the version of MLKit being used. It works successfully on MacOS and in our automated build environment, but on Windows [in Parallels] the builds just freeze during this step:
3> Task Parameter:VsInstallRoot=C:\Program Files\Microsoft Visual Studio\2022\Preview
3> Task Parameter:AllowUnsecureUrls=False
3> Task Parameter:DestinationBase=C:\...\AppData\Local\XamarinBuildDownloadCache\
3> Extracting C:\...\AppData\Local\XamarinBuildDownloadCache\MLKCore-8.0.0.tgz to C:\...\AppData\Local\XamarinBuildDownloadCache\MLKCore-8.0.0
And this is only if I have build output set to Diagnostics. At default settings, it looks like things just freeze up and I need to cancel the build. 'Run' from the menu seems to work properly. It feels like this is likely an adjacent issue, but maybe getting this library up to the latest version of MLKit would solve both problems?
Do we have a repository somewhere for the .JimmyPun610 libraries that this one references?
Yes it does include MLKCore-8.0.0 in the latest build. Maybe neee to find another way to due with it
@JimmyPun610 - do you happen to have your most recent copy of the MLKBarcode iOS API surface? I've gotten the underlying libraries working with the AdamEssenmacher fork of the GoogleApisForiOSComponents (https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/discussions/20) and am about to start digging into the API level changes that seem to be breaking the SampleApp. If you had a diff on the ApiDefinition.cs file, that'd be super helpful :)
Btw where can we find the source code for these two packages: Xamarin.MLKit.iOS.BarcodeScanning.JimmyPun610 Xamarin.MLKit.iOS.Core.JimmyPun610 ?
Thanks
@danardelean - I'm hoping to submit a PR soon that integrates the library I mentioned above rather than the custom builds that are referenced above. Just managed to get them working in MAUI with a local fork of this repo, so look for that soon, hopefully we can get it integrated here.
@bengavin even if it doesn't get merged and you publish the local repository please comment with a link to the repository. Thanks!
Anyone managed to find a working solution for this?
Btw where can we find the source code for these two packages: Xamarin.MLKit.iOS.BarcodeScanning.JimmyPun610 Xamarin.MLKit.iOS.Core.JimmyPun610 ?
Thanks
Here it is https://github.com/JimmyPun610/GoogleApisForiOSComponents But this repo is basically forked from the original repo that does not include much logic change. I think https://github.com/AdamEssenmacher/GoogleApisForiOSComponents will be the most updated repo for this, it would be also great to transfer to it
I just published https://www.nuget.org/packages/AdamE.MLKit.iOS.BarcodeScanning, thanks to a major contribution to https://github.com/AdamEssenmacher/GoogleApisForiOSComponents from @bengavin. It has an -alpha suffix pending some validation from the community. These should be compatible with https://github.com/TobiasBuchholz/Plugin.Firebase.
Please check it out and report any issues over at https://github.com/AdamEssenmacher/GoogleApisForiOSComponents.
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
Thank you for the contribution, just tried to merge and build the nuget package but not sure why the dependencies are not updated. Will try to take sometime on this weekend.
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
It looks the packages still missing some file for Xamarin?
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Jimmy Pun\.nuget\packages\adame.firebase.ios.installations\10.24.0.2\lib\net6.0-ios16.1\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64\FirebaseInstallations.framework\FirebaseInstallations_Privacy.bundle\PrivacyInfo.xcprivacy'
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
It looks the packages still missing some file for Xamarin?
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Jimmy Pun\.nuget\packages\adame.firebase.ios.installations\10.24.0.2\lib\net6.0-ios16.1\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64\FirebaseInstallations.framework\FirebaseInstallations_Privacy.bundle\PrivacyInfo.xcprivacy'
Not sure what might be happening, I do have that file in my local package directory:
pwd: ...packages/adame.firebase.ios.installations/10.24.0.2/lib/net6.0-ios16.1/Firebase.Installations.resources/FirebaseInstallations.xcframework/ios-arm64/FirebaseInstallations.framework/FirebaseInstallations_Privacy.bundle
ls: drwxr-xr-x@ 4 bengavin staff 128 Jun 9 20:00 . drwxr-xr-x@ 7 bengavin staff 224 Jun 9 20:00 .. -rwxr--r--@ 1 bengavin staff 808 Apr 29 14:04 Info.plist -rwxr--r--@ 1 bengavin staff 1105 Apr 29 14:04 PrivacyInfo.xcprivacy
My guess is that, since you're on Windows, you're running into the 255 character path limit, probably similar to this:
https://github.com/dotnet/maui/issues/17828
The solution seems to be getting out of visual studio and working via the command line, or one of the other workarounds listed in that thread.
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
It looks the packages still missing some file for Xamarin?
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Jimmy Pun\.nuget\packages\adame.firebase.ios.installations\10.24.0.2\lib\net6.0-ios16.1\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64\FirebaseInstallations.framework\FirebaseInstallations_Privacy.bundle\PrivacyInfo.xcprivacy'
Not sure what might be happening, I do have that file in my local package directory:
pwd: ...packages/adame.firebase.ios.installations/10.24.0.2/lib/net6.0-ios16.1/Firebase.Installations.resources/FirebaseInstallations.xcframework/ios-arm64/FirebaseInstallations.framework/FirebaseInstallations_Privacy.bundle
ls: drwxr-xr-x@ 4 bengavin staff 128 Jun 9 20:00 . drwxr-xr-x@ 7 bengavin staff 224 Jun 9 20:00 .. -rwxr--r--@ 1 bengavin staff 808 Apr 29 14:04 Info.plist -rwxr--r--@ 1 bengavin staff 1105 Apr 29 14:04 PrivacyInfo.xcprivacy
My guess is that, since you're on Windows, you're running into the 255 character path limit, probably similar to this:
The solution seems to be getting out of visual studio and working via the command line, or one of the other workarounds listed in that thread.
Just use Mac to build and it's working, just updated the packages Maui 8.0.40.1 XamarinForms 6.4.0.1 Hopefully it will work. Doing some build test.
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
It looks the packages still missing some file for Xamarin?
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Jimmy Pun\.nuget\packages\adame.firebase.ios.installations\10.24.0.2\lib\net6.0-ios16.1\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64\FirebaseInstallations.framework\FirebaseInstallations_Privacy.bundle\PrivacyInfo.xcprivacy'
Not sure what might be happening, I do have that file in my local package directory: pwd: ...packages/adame.firebase.ios.installations/10.24.0.2/lib/net6.0-ios16.1/Firebase.Installations.resources/FirebaseInstallations.xcframework/ios-arm64/FirebaseInstallations.framework/FirebaseInstallations_Privacy.bundle ls: drwxr-xr-x@ 4 bengavin staff 128 Jun 9 20:00 . drwxr-xr-x@ 7 bengavin staff 224 Jun 9 20:00 .. -rwxr--r--@ 1 bengavin staff 808 Apr 29 14:04 Info.plist -rwxr--r--@ 1 bengavin staff 1105 Apr 29 14:04 PrivacyInfo.xcprivacy My guess is that, since you're on Windows, you're running into the 255 character path limit, probably similar to this: dotnet/maui#17828 The solution seems to be getting out of visual studio and working via the command line, or one of the other workarounds listed in that thread.
Just use Mac to build and it's working, just updated the packages Maui 8.0.40.1 XamarinForms 6.4.0.1 Hopefully it will work. Doing some build test.
I tried this yesterday and it did not work for me i was getting the exact same error, I even tried it out in a fresh project as well...
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
It looks the packages still missing some file for Xamarin?
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Jimmy Pun\.nuget\packages\adame.firebase.ios.installations\10.24.0.2\lib\net6.0-ios16.1\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64\FirebaseInstallations.framework\FirebaseInstallations_Privacy.bundle\PrivacyInfo.xcprivacy'
Not sure what might be happening, I do have that file in my local package directory: pwd: ...packages/adame.firebase.ios.installations/10.24.0.2/lib/net6.0-ios16.1/Firebase.Installations.resources/FirebaseInstallations.xcframework/ios-arm64/FirebaseInstallations.framework/FirebaseInstallations_Privacy.bundle ls: drwxr-xr-x@ 4 bengavin staff 128 Jun 9 20:00 . drwxr-xr-x@ 7 bengavin staff 224 Jun 9 20:00 .. -rwxr--r--@ 1 bengavin staff 808 Apr 29 14:04 Info.plist -rwxr--r--@ 1 bengavin staff 1105 Apr 29 14:04 PrivacyInfo.xcprivacy My guess is that, since you're on Windows, you're running into the 255 character path limit, probably similar to this: dotnet/maui#17828 The solution seems to be getting out of visual studio and working via the command line, or one of the other workarounds listed in that thread.
Just use Mac to build and it's working, just updated the packages Maui 8.0.40.1 XamarinForms 6.4.0.1 Hopefully it will work. Doing some build test.
I tried this yesterday and it did not work for me i was getting the exact same error, I even tried it out in a fresh project as well...
You may probably need to try the version just released. Maui 8.0.40.1 Build and run test pass in Android iOS not tested Xamarin Forms 6.4.0.2 Build and test pass in Android Build test in iOS
I've created a PR that updates to the 'alpha2' variant of the package above and it seems to work properly across the 3 builds I've been able to test [iOS Xamarin, iOS MAUI, Android MAUI], my local build is having issues with the Android Xamarin sample and I'm uncertain as to why, the errors don't make any sense :)
It looks the packages still missing some file for Xamarin?
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Jimmy Pun\.nuget\packages\adame.firebase.ios.installations\10.24.0.2\lib\net6.0-ios16.1\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64\FirebaseInstallations.framework\FirebaseInstallations_Privacy.bundle\PrivacyInfo.xcprivacy'
Not sure what might be happening, I do have that file in my local package directory:
pwd: ...packages/adame.firebase.ios.installations/10.24.0.2/lib/net6.0-ios16.1/Firebase.Installations.resources/FirebaseInstallations.xcframework/ios-arm64/FirebaseInstallations.framework/FirebaseInstallations_Privacy.bundle
ls: drwxr-xr-x@ 4 bengavin staff 128 Jun 9 20:00 . drwxr-xr-x@ 7 bengavin staff 224 Jun 9 20:00 .. -rwxr--r--@ 1 bengavin staff 808 Apr 29 14:04 Info.plist -rwxr--r--@ 1 bengavin staff 1105 Apr 29 14:04 PrivacyInfo.xcprivacy
My guess is that, since you're on Windows, you're running into the 255 character path limit, probably similar to this:
The solution seems to be getting out of visual studio and working via the command line, or one of the other workarounds listed in that thread.
It looks like the Xamarin Android dependent libraries updated, but it is blocking the build. So I have rolled back the Xamarin Android library version. (Actually I prefer freeze these for Xamarin Forms)
Just publish the latest version. Maui 8.0.40.1 Xamarin Forms 6.4.0.2
I think it should fix this issue. Thank you for the contribution @bengavin and @AdamEssenmacher
I'm doing final validation through our build pipelines now, but for local debugging, 8.0.40.1 works on both my iOS and Android test devices. I'll update this post once I've verified the actual published clients, but looking good so far!
EDIT: Released versions work as well.
I'm trying to install 8.0.40.1 but I run into long path issue. My path is C:\Nuget\adame.firebase.ios.core\10.24.0.2\lib\net6.0-ios16.1\Firebase.Core.resources\FirebaseCoreInternal.xcframework\ios-arm64_x86_64-simulator\FirebaseCoreInternal.framework\Modules\FirebaseCoreInternal.swiftmodule\arm64-apple-ios-simulator.private.swiftinterface, which is 267 characters long. I could shorten "Nuget" directory to "N", but I wouldn't shorten enough. What can I do? Why some of you can make it work and I can't? Thanks in advance for your help.
I'm trying to install 8.0.40.1 but I run into long path issue. My path is C:\Nuget\adame.firebase.ios.core\10.24.0.2\lib\net6.0-ios16.1\Firebase.Core.resources\FirebaseCoreInternal.xcframework\ios-arm64_x86_64-simulator\FirebaseCoreInternal.framework\Modules\FirebaseCoreInternal.swiftmodule\arm64-apple-ios-simulator.private.swiftinterface, which is 267 characters long. I could shorten "Nuget" directory to "N", but I wouldn't shorten enough. What can I do? Why some of you can make it work and I can't? Thanks in advance for your help.
The long path issue in Windows 11 is a known problem where users encounter difficulties with file paths that exceed a certain length. Typically, Windows has a maximum path length limit of 260 characters.
To address this issue, you can enable long path support by editing the registry and group policy settings. Here’s a step-by-step guide:
Registry Editor: Press Win + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Find the LongPathsEnabled key and set its value to 1. Close the Registry Editor.
Group Policy Editor: Press Win + R, type gpedit.msc, and press Enter. Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem. Find and enable the Enable Win32 long paths policy.
After making these changes, restart your computer for them to take effect. Also update Visual Studio to the latest version available and also update windows to the latest version.
@JimmyPun610 you're going to end up getting a lot of issues opened here complaining about the long path problem on Windows builds. It's not something you'll be able to fix in this project, so feel free to punt them over to the issue on my fork where I'll in turn punt them to the MAUI issue where they'll in turn punt them to the Visual Studio issue
At Plugin.Firebase, we added a blurb in our readme documenting the workaround steps.
I'm trying to install 8.0.40.1 but I run into long path issue. My path is C:\Nuget\adame.firebase.ios.core\10.24.0.2\lib\net6.0-ios16.1\Firebase.Core.resources\FirebaseCoreInternal.xcframework\ios-arm64_x86_64-simulator\FirebaseCoreInternal.framework\Modules\FirebaseCoreInternal.swiftmodule\arm64-apple-ios-simulator.private.swiftinterface, which is 267 characters long. I could shorten "Nuget" directory to "N", but I wouldn't shorten enough. What can I do? Why some of you can make it work and I can't? Thanks in advance for your help.
The long path issue in Windows 11 is a known problem where users encounter difficulties with file paths that exceed a certain length. Typically, Windows has a maximum path length limit of 260 characters.
To address this issue, you can enable long path support by editing the registry and group policy settings. Here’s a step-by-step guide:
Registry Editor: Press Win + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Find the LongPathsEnabled key and set its value to 1. Close the Registry Editor.
Group Policy Editor: Press Win + R, type gpedit.msc, and press Enter. Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem. Find and enable the Enable Win32 long paths policy.
After making these changes, restart your computer for them to take effect. Also update Visual Studio to the latest version available and also update windows to the latest version.
Thanks, but I still encounter the same issue. Just to be precise, I'm still on Win10, not 11.
@JimmyPun610 you're going to end up getting a lot of issues opened here complaining about the long path problem on Windows builds. It's not something you'll be able to fix in this project, so feel free to punt them over to the issue on my fork where I'll in turn punt them to the MAUI issue where they'll in turn punt them to the Visual Studio issue
At Plugin.Firebase, we added a blurb in our readme documenting the workaround steps.
Thanks, this worked.
Are you guys facing a build error on the latest version on Android?
@JimmyPun610 This still did not get resolved with the latest version apparently