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

Errors that packages does not exist when integrate two different libraries #8332

Open
syakimchik opened this issue Sep 14, 2023 · 10 comments
Open
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@syakimchik
Copy link

Android application type

.NET Android (net7.0-android, etc.)

Affected platform version

VS 2023 17.6.3 (build 421), .NET 7.0

Description

When I added Xamarin.DocumentReader.Api.Android and Xamarin.DocumentReader.Core.FullRfid.Android to the new project it built without any issues. But when I add another library, it cause problems in the first.
Mono cannot build references in the first library, but when I remove the second dependency it will build again.

Steps to Reproduce

  1. Create a new .NET MAUI App project.
  2. Add dependencies: Xamarin.DocumentReader.Api.Android and Xamarin.DocumentReader.Core.FullRfid.Android
  3. Build project. In the result, you will see that project will build successfully.
  4. Add Xamarin.Regula.FaceApi.Android and Xamarin.Regula.FaceApi.Core.Android
  5. Build project again. You will see that errors that some classes in dependencies from step 2 are missing.

Did you find any workaround?

No response

Relevant log output

/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/javac -J-Dfile.encoding=UTF8 "@/var/folders/46/mp5fvk691s7fh0wn1_mghjfh0000gn/T/tmpmeWoI8.tmp" -target 1.8 -source 1.8 
    obj/Debug/net7.0-android/android/src/mono/com/regula/documentreader/api/listener/NetworkInterceptorListenerImplementor.java:8: error: package com.regula.documentreader.api.listener does not exist
    		com.regula.documentreader.api.listener.NetworkInterceptorListener
    		                                      ^
    obj/Debug/net7.0-android/android/src/mono/com/regula/documentreader/api/ble/BLEWrapper_IBleNfcApduListenerImplementor.java:8: error: package com.regula.documentreader.api.ble.BLEWrapper does not exist
    		com.regula.documentreader.api.ble.BLEWrapper.IBleNfcApduListener
@syakimchik syakimchik added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels Sep 14, 2023
@jonathanpeppers
Copy link
Member

It just looks like Xamarin.Regula.FaceApi.Android is missing dependencies. Do you need to report this to the owner of the Xamarin.Regula.FaceApi.Android NuGet package?

@jonathanpeppers jonathanpeppers added need-info Issues that need more information from the author. and removed needs-triage Issues that need to be assigned. labels Sep 19, 2023
@microsoft-github-policy-service
Copy link
Contributor

Hi @syakimchik. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Sep 19, 2023
@syakimchik
Copy link
Author

Hi @jonathanpeppers,
I'm software developer of the Xamarin.Regula.FaceApi.Android library.
What dependencies are missing?

If I build the project only with Xamarin.Regula.FaceApi.Android library, it works fine. and when I add Xamarin.DocumentReader.Api.Android without Xamarin.Regula.FaceApi.Android library, it works fine.

But something breaks when I add Xamarin.Regula.FaceApi.Android library. I don't see that something missing, because separately libraries works. But tother don't.

it happened when we moved to using MAUI. When we take our previous version of libraries that using Forms, we will not have any issues. Something wrong in the Mono platform, but I cannot understand what breaks it.

@microsoft-github-policy-service microsoft-github-policy-service bot added need-attention A xamarin-android contributor needs to review and removed need-info Issues that need more information from the author. labels Sep 19, 2023
@syakimchik
Copy link
Author

I've created library as described in the topic . It's easy for Android platform.
And those libraries don't have any issue when I use in a different projects. But I cannot use it together. Mono cannot build the project. I need to know the reason, what I should fix in the library to solve it.

Both libraries have the same dependencies with the same versions. As I said, when we used Xamarin Forms, we hadn't had any issues.

@jonathanpeppers
Copy link
Member

Is the problem one of your .aar files is missing and should be there? Does it work in .NET 8?

If so, it could be the problem described here (workarounds here, too): #8308 (comment)

@syakimchik
Copy link
Author

maui-error.zip

@jonathanpeppers, I've attached the project with .NET 8, but it doesn't work too.

I tried to apply your solution from #8308 (comment), but it doesn't work. I got even more errors.

Can you try to build sample above?

@syakimchik
Copy link
Author

Hi @jonathanpeppers ,
Do you have any news? Have you reproduced the issue?

@jpobst jpobst removed the need-attention A xamarin-android contributor needs to review label Mar 20, 2024
@Lug16
Copy link

Lug16 commented Apr 16, 2024

Hi @syakimchik, I'm facing the same issue.

Error JAVAC0000 javac: error: package com.regula.documentreader.api.ble does not exist
extends com.regula.documentreader.api.ble.BleWrapperCallback

The project is on MAUI 8.0

This is the set of references:
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'"> <PackageReference Include="Xamarin.DocumentReader.BTDevice.iOS" Version="6.8.318"/> <PackageReference Include="Xamarin.DocumentReader.Api.iOS" Version="7.1.3379"/> <PackageReference Include="Xamarin.DocumentReader.Core.FullRfid.iOS" Version="7.1.8787"/> <PackageReference Include="Xamarin.Regula.FaceApi.iOS" Version="6.1.1746"/> <PackageReference Include="Xamarin.FaceCore.Basic.iOS" Version="6.1.584"/> </ItemGroup> <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"> <PackageReference Include="Xamarin.DocumentReader.BTDevice.Android" Version="1.1.394"/> <PackageReference Include="Xamarin.DocumentReader.Api.Android" Version="7.1.9667"/> <PackageReference Include="Xamarin.DocumentReader.Core.FullRfid.Android" Version="7.1.10515"/> <PackageReference Include="Xamarin.AndroidX.DataBinding.ViewBinding" Version="8.0.2"/> <PackageReference Include="Xamarin.FaceCore.Basic.Droid" Version="6.1.407"/> <PackageReference Include="Xamarin.Regula.FaceApi.Android" Version="6.1.3021"/> </ItemGroup>

Any help would be very appreciated

@syakimchik
Copy link
Author

Hi @Lug16,
It's Xamarin issue. It's not problem in the Library.

@justinwojo
Copy link

justinwojo commented Apr 29, 2024

@syakimchik could you try adjusting one of the packages underlying aar name and see if that possibly fixes this?

image

My running theory is that with both of these nuget packages referencing the same name of aar's "api.aar" that it results in an overwrite or wrong reference which causes the compilation issue. I haven't set up a test project to test the theory, but it seems logical as to why they work independently but not when both are referenced.

The old version of this SDK (Xamarin.Regula.FaceApi.Core.Android) the underlying aar was called "core.aar", hence why I think the theory holds as to why it used to work fine with that SDK and not this one as there wasn't a naming conflict.

EDIT: Theory is proved. If I go into my nuget cache folder, rename "api.aar" to something unique like "facecoreapi.aar", the app immediately compiles. I think it has to do with the fact that this face library has a dependency on the document sdk, which also has its own api.aar file. So it references the wrong one, and then has compile errors.

However, this results in a document exception error at runtime:
com.regula.documentreader.api.errors.DocumentReaderException: Cannot create native wrapper at com.regula.documentreader.api.BaseDocumentReader.lambda initializeDocumentReader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

6 participants