-
Notifications
You must be signed in to change notification settings - Fork 535
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
Net7 and Net8 Android projects with AndroidLibrary try to generate binding instead of add it as reference like Xamarin project does #8609
Comments
If you just want to reference your Java library but not generate a binding for it you'll need to add
More info on the available options is available here: |
Hello @jpobst, I tried with bind=false, using inlude and update, with include bind=false is ignored and have the same errors that we had when we didn´t put bind with update I have different errors but all of them refers to styles that are in those library files What do you thing we are doing wrong? thank your for your support. |
I'm afraid resources and packaging are out of my area of expertise. The original assignees of this issue are the best people to help, likely after the holidays. |
Thank you anyway @jpobst for your quickly answer and support |
So, this should be what you would do for no C# binding: <AndroidLibrary Update="foo.aar" Bind="false" /> @rfrailemartinez can you share a |
Hello @jpobst , binlog.zip Compile is ok, implementation generates the error, This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. Compilación del proyecto "TestNet.csproj" terminada -- ERROR. |
If we look at the first error:
What Is it one of the |
Hi @jonathanpeppers, if I open "VDDocumentCapture.aar" file with zip,
This aar is one of the files we have: thanks for your support |
From what it looks like, the extracted
This
Is there a way we could create a sample project with the same problem? Maybe one that doesn't have 100+ |
Hello @jonathanpeppers,
Only a MainActivity to test it. Looking into folder "obj\Debug\net8.0-android34.0\lp" I think most of them are from google Please, tell me a way to help you, if you want I can try to search the subfolders numbers Thank for your support |
@rfrailemartinez can you share this project as a |
Hi @jonathanpeppers, thank you |
If you are able, you can use the email address on my GitHub profile. Thanks! |
Hello @jonathanpeppers, I have shared zip file with project to your gmail account. Thank you |
I removed these lines from <!-- <ItemGroup>
<AndroidLibrary Remove="Jars\veridas_android_sdk-release.aar" />
</ItemGroup>
<ItemGroup>
<LibraryProjectZip Include="Jars\veridas_android_sdk-release.aar" />
</ItemGroup> --> But the test project builds for me even without this change. Should I get an error? |
@jonathanpeppers if I remove this lines and remove bin and obj folders of both projects, VeridasAndroidNetSDk.csproj compiles ok, but TestNet stop showing the namespace of this project: But if you remove both of them but add:
TestNet works again: And then if you start TesTNet we have the same implementation errors I don't know why I have to put "AndroidLibrary Update="Jars\veridas_android_sdk-release.aar" Bind="true"", because I think in a Binding project this is the default for this kind of file, or that what I think reading: |
Hi @jonathanpeppers, thank you |
What is an example of what worked and doesn't work using the "new" item groups? |
Hello @jonathanpeppers mono-android:
Net8:
References version are not the same because Android 34 requires some new versiones mono-android:
Net8
Making more test before send you info:
Implementation error (the same): What can be happening? Thank you for your support |
When you say "mono-android", do you mean Xamarin.Android? Or something older than .NET 8? .NET 7? I'm not sure if the new There are some fixes in .NET 8 that could be related: |
Good morning @jonathanpeppers I think these fixes are not related, because in this moment, Net8 version works well in Android 10 emulator, fails during implementation in Android 12.1 and 13 emulators. |
Do you need to support Xamarin.Android? It is end-of-life soon: https://dotnet.microsoft.com/platform/support/policy/xamarin If .NET 8 is working for you, there is likely some fix there (there are a lot) that is making it work. |
Sorry for my English @jonathanpeppers |
What does "it fails during implementation" mean? Does it crash at runtime? If so, what is the crash, can you share adb logcat output of the crash? |
@jonathanpeppers it is not a runtime, it is deployment error thank you |
So you were probably running into this problem with deployment, if it was a problem with a specific device: #8329 I think this was fixed in recent version of Visual Studio (it was an IDE-side fix). But it's hard to know without seeing the error message or a Is everything working now as expected? Can we close this one? |
Thank you very much, the binlog is the same I sent some days ago., but remember it has +100 aars in the test project. |
Android application type
.NET Android (net7.0-android, net8.0-android, etc.)
Affected platform version
Net 7 and Net 8
Description
We have somo bindings of libraries that references other libraries. In Xamarin projects we only make binding of the principal aar file, like libraryProjectZip, the one that we want to exponse methods to our code. This project is added to the final project as rejerence or as nuget. The rest of the libraries we added to final project as AndroidLibrary, when we compile the project, this files are visible for the java virtual machine and everithing works ok.
In new Net 8 or 7 android project, if you mark a aar file as AndroidLibrary, in spite of doing the same as Xamarin Android project, it try to generate a Android binding of the file and report the same errors that you have if you create a binding project.
We expect tp have the same behavoir that we have in Xmarin projects:
if is a binding project, try to generate binding an expose all methods
if is a Android porject, expose this file to JVM.
This problem make us impossible to migrate lot of projects that we jave with native bindings.
Steps to Reproduce
Create a Net 8 Android project
Add aar file
Compile project
you will see the same errors as if you put this file in a Net 8 Android Binding Project
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: