xamarin / GooglePlayServicesComponents

Other
314 stars 146 forks source link

Invalid item ID image-1.0.0-beta1 #617

Closed NetworkGithub closed 1 year ago

NetworkGithub commented 2 years ago

I am unable to build after adding Xamarin.Google.Android.ODML.Image 1.0.0-beta1

There is a repo available at: https://github.com/NetworkGithub/CSSClientAppsXamarinSampleCode2

I have the error: ....\packages\Xamarin.Build.Download.0.11.2\build\Xamarin.Build.Download.targets(52,3): error XBD020: Invalid item ID image-1.0.0-beta1

I have searched for "1.0.0-beta1" in the project directory and come up with the following.

Search "1.0.0-beta1" (12 hits in 4 files of 60 searched) C:\GitHub\repos\microsoft\Old\CSSClientAppsXamarinSampleCode2\Xamarin.CameraX1\obj\CameraX.csproj.nuget.g.targets (2 hits) Line 50: Line 50: C:\GitHub\repos\microsoft\Old\CSSClientAppsXamarinSampleCode2\Xamarin.CameraX1\obj\Debug\120\CameraX.csproj.AssemblyReference.cache (2 hits) Line 136: v4.0.30319 Line 136: v4.0.30319 C:\GitHub\repos\microsoft\Old\CSSClientAppsXamarinSampleCode2\Xamarin.CameraX1\obj\project.assets.json (6 hits) Line 2028: "Xamarin.Google.Android.ODML.Image/1.0.0-beta1": { Line 2142: "Xamarin.Google.Android.ODML.Image": "1.0.0-beta1", Line 2328: "Xamarin.Google.Android.ODML.Image": "1.0.0-beta1", Line 4404: "Xamarin.Google.Android.ODML.Image/1.0.0-beta1": { Line 4407: "path": "xamarin.google.android.odml.image/1.0.0-beta1", Line 4419: "xamarin.google.android.odml.image.1.0.0-beta1.nupkg.sha512", C:\GitHub\repos\microsoft\Old\CSSClientAppsXamarinSampleCode2\Xamarin.CameraX1\obj\project.nuget.cache (2 hits) Line 82: "~\.nuget\packages\xamarin.google.android.odml.image\1.0.0-beta1\xamarin.google.android.odml.image.1.0.0-beta1.nupkg.sha512", Line 82: "~\.nuget\packages\xamarin.google.android.odml.image\1.0.0-beta1\xamarin.google.android.odml.image.1.0.0-beta1.nupkg.sha512",

Xamarin.Android Version 6.0 Windows 10

Xamarin 17.1.0.329 (d17-1@bc74cf0) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.1.0.87 (remotes/origin/main@d50fb5635) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 17.1.8 (590388a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 12.2.4.3 (d17-1/fc1125e) Xamarin.Android Reference Assemblies and MSBuild support. Mono: adf1bc4 Java.Interop: xamarin/java.interop/d17-1@7ac33610 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.37.1@0893b3b Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-1@db125a7

Build settings (tools)

    <AndroidDexTool>d8</AndroidDexTool>
    <AndroidLinkTool>r8</AndroidLinkTool>
    <AndroidUseAapt2>true</AndroidUseAapt2>
    <AndroidEnableDesugar>true</AndroidEnableDesugar>
deelw commented 2 years ago

I have the same issue when referencing Xamarin.GooglePlayServices.MLKit.Text.Recognition v116.3.0 or v117.0.1. Using version 116.2.0.5 works fine.

I'm getting this error: Xamarin.Build.Download.targets(3,3): Error XBD020: Invalid item ID image-1.0.0-beta1 (XBD020)

I think this is also about a reference to Xamarin.Google.Android.ODML.Image 1.0.0-beta1

Visual Studio for Mac Enterprise version 8.10.22 (build 11) Project properties: TargetFrameworkVersion 12.0 Minimum Android version Android 10.0 API level 29 Target Android version Android 12.0 API level 31

@moljac is this topic the same issue as https://github.com/xamarin/XamarinComponents/issues/1293 ?

moljac commented 2 years ago

@moljac is this topic the same issue as xamarin/XamarinComponents#1293 ?

I think so, but I am not 100% sure. There is more and more stable maven packages depending on prerelease packages, but I think the culprit is XBD and version parsing. I must dive in to say something specific.

deelw commented 2 years ago

I think you're right about the XBD. Extra info: when I upgrade from Xamarin.GooglePlayServices.MLKit.Text.Recognition 116.2.0.5 to v116.3.0 it works until I delete my bin and obj folders and then restore packages. After upgrading to v117.0.1 also downgrading to 116.2.0.5 results in the same error until I delete the packages and restore them.

dineshkandan commented 2 years ago

Hi @deelw

any fixes for this issue i am also facing same error

Thanks

deelw commented 2 years ago

Hi @dineshkandan There are no fixes yet, this ticket is not yet assigned. You could thumb up my issue as indication I'm not the only one waiting for a solution. In the meantime I'm still referencing version 116.2.0.5 of Xamarin.GooglePlayServices.MLKit.Text.Recognition and version 116.1.5.5 of Xamarin.GooglePlayServices.MLKit.BarcodeScanning to ignore indirect references of Xamarin.Google.Android.ODML.Image 1.0.0-beta1

SaqibS commented 2 years ago

Just to add a +1; in my case with Xamarin.GooglePlayServices.MLKit.BarcodeScanning

MarvinFrankenfeld commented 2 years ago

Please support this, as we need to have the newest text recognition package.

ygl-rg commented 2 years ago

Hi @dineshkandan There are no fixes yet, this ticket is not yet assigned. You could thumb up my issue as indication I'm not the only one waiting for a solution. In the meantime I'm still referencing version 116.2.0.5 of Xamarin.GooglePlayServices.MLKit.Text.Recognition and version 116.1.5.5 of Xamarin.GooglePlayServices.MLKit.BarcodeScanning to ignore indirect references of Xamarin.Google.Android.ODML.Image 1.0.0-beta1

Thx for your info. I have spent the whole afternoon on figuring out the correct version until saw your post.

cout-pranav commented 2 years ago

Hi @ygl-rg whether Xamarin.GooglePlayServices.MLKit.BarcodeScanning 116.1.5.5 works for barcode scanning. If yes then can you please share me sample code.

moljac commented 1 year ago

try updating (explicitly adding reference) to projects:

<PackageReference Include="Xamarin.Build.Download" Version="0.11.3" />

And please report if this works.

Thanks

deelw commented 1 year ago

Hi @moljac, thanks, yes, it works!

I upgraded to the current latest version of Xamarin.GooglePlayServices.MLKit.Text.Recognition 118.0.0.1 and Xamarin.GooglePlayServices.MLKit.BarcodeScanning 118.0.0.1.

I had to add some usings because some classes moved to other namespaces:

skir commented 1 year ago

Hi, I got this issue first time today, even though I added MLKit libraries into my project a week ago. Whole week I was debugging and made several alpha releases, and everything was working fine. But today the project just refuses to be built. I am referencing Xamarin.Build.Download 0.11.3, Xamarin.Google.MLKit.BarcodeScanning 117.0.2.1 (Xamarin.Google.MLKit, not Xamarin.GooglePlayServices.MLKit), Xamarin.Google.Android.ODML.Image 1.0.0.1-beta1 (not 1.0.0-beta1). I was trying to restore yesterdays state of the project build. Somehow I have managed to get successful build with no modifications to code or libraries. I just used Release configuration and Nougat device. After this successful build, all other configurations and devices worked fine, until Visual Studio restart. Now this trick does not work. Next what I did, I lowered the Xamarin.Google.Android.ODML.Image version to 1.0.0-beta1. The versions for all other MLKit libs were lowered by the package manager too. And guess what, the build works again, even if I update everything back, and perform clean and rebuild. Until I restart Visual Studio. I hate when such unpredictable and unstable situations happen. I do get that the library version says beta, but I expect this only to affect stability in runtime, not in build time. 👎

deelw commented 1 year ago

Hi @skir, when I had trouble making it work, I experienced that I had to delete the obj and bin folders before a restore all and a (re)build. Also when all seems fine but fails after a restart of VS.

So, even when it worked all right with Xamarin.GooglePlayServices.MLKit.Text.Recognition version 116.2.0.5, it kept working for a while after updating to v116.3.0 or v117.0.1. When I restarted VS for mac or when I deleted the bin and obj folders the error occurred. And also when I downgraded to the working version 116.2.0.5 after the error occurred my builds kept failing even after a restart of VS for mac. In all cases I did get trustworthy results after deleting my obj and bin folders.

For me, now all works fine after adding Xamarin.Build.Download version 0.11.3

skir commented 1 year ago

Hi @deelw, the thing is I already had Xamarin.Build.Download 0.11.3 in my project when I started getting this error. Also, I was getting this error only on that day when I wrote about it (3 day ago). Now everything works fine, and I don't know why.

moljac commented 1 year ago

Issue seems to be fixed. Closing this one. If the issue persists open a new issue, please.

MihaMarkic commented 1 month ago

I had to remove iOS projects from my solution (not configured as build in android case).