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

[iOS] Current MAUI version 8.0.21 not working on iOS #240

Open
dinisvieira opened this issue May 3, 2024 · 35 comments
Open

[iOS] Current MAUI version 8.0.21 not working on iOS #240

dinisvieira opened this issue May 3, 2024 · 35 comments
Labels
bug Something isn't working

Comments

@dinisvieira
Copy link

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.

@dinisvieira dinisvieira added the bug Something isn't working label May 3, 2024
@HaileyKim04
Copy link

Same issue

@IrynaDoroshenkoDev
Copy link

same issue, Workaround
Downgraded to version 8.0.0.1 and everything works again. - works for me

@bengavin
Copy link
Contributor

bengavin commented May 13, 2024

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)

@vhugogarcia
Copy link

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

@KonstantinKellermann
Copy link

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.

@bengavin
Copy link
Contributor

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?

@JimmyPun610
Copy link
Owner

Yes it does include MLKCore-8.0.0 in the latest build.
Maybe neee to find another way to due with it

@bengavin
Copy link
Contributor

bengavin commented Jun 3, 2024

@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 (AdamEssenmacher/GoogleApisForiOSComponents#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 :)

@danardelean
Copy link

danardelean commented Jun 6, 2024

Btw where can we find the source code for these two packages:
Xamarin.MLKit.iOS.BarcodeScanning.JimmyPun610
Xamarin.MLKit.iOS.Core.JimmyPun610 ?

Thanks

@bengavin
Copy link
Contributor

bengavin commented Jun 6, 2024

@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.

@danardelean
Copy link

@bengavin even if it doesn't get merged and you publish the local repository please comment with a link to the repository. Thanks!

@FreakyAli
Copy link

Anyone managed to find a working solution for this?

@JimmyPun610
Copy link
Owner

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

@AdamEssenmacher
Copy link

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.

@bengavin
Copy link
Contributor

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 :)

@JimmyPun610
Copy link
Owner

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.

@JimmyPun610
Copy link
Owner

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'

@bengavin
Copy link
Contributor

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.

@JimmyPun610
Copy link
Owner

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.

@FreakyAli
Copy link

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...

@JimmyPun610
Copy link
Owner

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

@JimmyPun610
Copy link
Owner

JimmyPun610 commented Jun 13, 2024

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.

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

@bengavin
Copy link
Contributor

bengavin commented Jun 13, 2024

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.

@michele-guion
Copy link

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.

@vhugogarcia
Copy link

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.

@AdamEssenmacher
Copy link

@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.

@michele-guion
Copy link

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.

@michele-guion
Copy link

@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.

@FreakyAli
Copy link

FreakyAli commented Jun 18, 2024

Are you guys facing a build error on the latest version on Android?

@FreakyAli
Copy link

@JimmyPun610 This still did not get resolved with the latest version apparently

@bengavin
Copy link
Contributor

bengavin commented Jun 27, 2024

@FreakyAli @LeoJHarris - We are successfully using the latest version [8.0.40.1] in our apps across both iOS and Android [.NET 8 MAUI]. Can you clarify which issue(s) specifically you're running into locally?

In our local project file, we have the following item to workaround some Android specific build issues due to 'duplicate' symbol definitions:

	<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
	  <PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.0.5">
	  </PackageReference>
	  <PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.4">
	  </PackageReference>
	  <PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.4">
	  </PackageReference>
	  <PackageReference Include="Xamarin.AndroidX.Activity" Version="1.9.0.3" />
	  <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.3" />
	</ItemGroup>

@FreakyAli
Copy link

@bengavin @JimmyPun610 If this is the case and our Library is dependent on these native packages shouldn't our library handle adding these packages internally? So that a user not natively well-versed can easily install the scanner too?

I mean I have done this in the Biometric Plugin, so it should be just as easy to do here too:

https://github.com/FreakyAli/Plugin.Maui.Biometric/blob/a906545f1dc43fc702510a7b2dc2a7e2212b2d0c/Plugin.Maui.Biometric/Plugin.Maui.Biometric/Plugin.Maui.Biometric.csproj#L55

@FreakyAli
Copy link

FreakyAli commented Jun 27, 2024

@bengavin Also the issue I am facing is probably different this is my error:

Severity Code Description Project File Line Suppression State
Error Could not find a part of the path 'C:\Users\hamaspik002.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'.

and stack trace:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\hamaspik002.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'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.File.Create(String path)
at NuGet.Packaging.StreamExtensions.Testable.MmapCopy(Stream inputStream, String fileFullPath, Int64 size)
at NuGet.Packaging.StreamExtensions.Testable.CopyToFile(Stream inputStream, String fileFullPath)
at NuGet.Packaging.PackageFileExtractor.ExtractPackageFile(String source, String target, Stream stream)
at NuGet.Packaging.PackageArchiveReader.CopyFiles(String destination, IEnumerable1 packageFiles, ExtractPackageFileDelegate extractFile, ILogger logger, CancellationToken token) at NuGet.Packaging.PackageReaderBase.CopyFilesAsync(String destination, IEnumerable1 packageFiles, ExtractPackageFileDelegate extractFile, ILogger logger, CancellationToken cancellationToken)
at NuGet.Packaging.PackageExtractor.<>c__DisplayClass5_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Common.ConcurrencyUtilities.d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Packaging.PackageExtractor.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.ProjectRestoreCommand.d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NuGet.Commands.ProjectRestoreCommand.<>c__DisplayClass15_1.<b__4>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at NuGet.Commands.ProjectRestoreCommand.<InstallPackagesAsync>d__15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.ProjectRestoreCommand.<TryRestoreAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreCommand.<ExecuteRestoreAsync>d__86.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreRunner.<ExecuteAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Commands.RestoreRunner.<CompleteTaskAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.Commands.RestoreRunner.<RunWithoutCommit>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.DependencyGraphRestoreUtility.<PreviewRestoreProjectsAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.NuGetPackageManager.<PreviewBuildIntegratedProjectsActionsAsync>d__89.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.NuGetPackageManager.<PreviewProjectsInstallPackageAsync>d__75.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.VisualStudio.NuGetProjectManagerService.<>c__DisplayClass22_0.<<GetInstallActionsAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.PackageManagement.VisualStudio.NuGetProjectManagerService.<CatchAndRethrowExceptionAsync>d__331.MoveNext()

@bengavin
Copy link
Contributor

@FreakyAli - That error in particular is due to the long path problem, see this [it's applicable to Windows 10 too]:

https://github.com/TobiasBuchholz/Plugin.Firebase?tab=readme-ov-file#windows-11-long-path-issue

On the references front, even if we put them in there, you may run into problems in the client app due to other Android refs that need to be manually added, it's just a thing that needs to happen in MAUI + Android land, as you reference different projects / plugins / etc, you may introduce different 'baseline' dependencies that have conflicting versions and the linker can't figure it out. Putting the references directly in the 'endpoint' project fixes the issue, and the ones I linked above are just the ones our project needs, they may -NOT- be the ones your project needs.

You'll be 'guided' to the issue resolution during the build process if you watch the logs, it will suggest places that there are conflicts and thus far, we've been able to discern the underlying problematic library and manually add the reference.

@FreakyAli
Copy link

@bengavin I really appreciate the insight, thanks I'll look into this further and get back if I have any queries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests