java.lang.noclassdeffounderror“失败的分辨率:landroid/usport/v4/v4/util/simplearraymap”

发布于 2025-02-03 05:17:26 字数 1417 浏览 2 评论 0原文

总体而言,我是Dot Net Maui和Android开发的新手。

我正在尝试从MAUI Android应用程序调用现有的.AAR库。 。 .com/download/)。我有图书馆的源代码,并且能够在Android Studio中构建它来生成AAR。 Android Studio项目由应用程序和图书馆组成。提供的应用程序似乎运行得足够好,并毫无问题地将图书馆打电话给图书馆。

我想从MAUI应用程序中使用AAR。我为AAR创建了一个“ Android Java库绑定”,它似乎可以构建正常。我可以在VS2022 Object Explorer中看到我期望的一切。当我第一次使用毛伊岛应用程序中的库时,我会得到一个“ java.lang.noclassdeffounderror”的例外,“分辨率失败的分辨率:landroid/support/v4/v4/v4/util/simplearraymap”。

从一些谷歌搜索中,我最好的猜测是,Android支持库V4(或缺乏)可能是一个问题?我尝试添加xamarin.support.v4 nuget软件包,但Google搜索结果较低(MSB4018,“ verifyVersionStask”任务出乎意料地失败了)。

AAR的Android Studio项目由以下SDK版本建立:

compileSdkVersion = 23
targetSdkVersion = 23
buildToolsVersion = "28.0.3"
minSdkVersionCanLib = 12
minSdkVersionApp = 16

在Android Studio Project依赖性:

api 'com.android.support:appcompat-v7:23.1.1'
api 'com.android.support:support-annotations:23.1.1'

Android Studio Project中,在首次开放表格Kvaser的网站上,促使我多次升级Gradle,直到看起来足够乐于构建,可以构建足够乐于构建在v5.4.1。

我的VS2022版本:Microsoft Visual Studio Community 2022(64位) - 预览版17.3.0 Preview 1.1

我尝试了很多事情,但是我不确定在这里描述多少或相关。请让我知道我是否错过了任何有帮助的东西。有人对如何修复此NoclassDeffoundError有任何想法吗?

我还将这个问题发布给了.NET MAUI GITHUB讨论委员会,网址为 https> https:https:// github。 com/dotnet/maui/descrodions/7652 ,我还附加了我的源代码。

I'm brand new to dot net MAUI and Android development in general.

I'm trying to call an existing .aar library from a maui android application. The .aar came from an android studio java project (Kvaser canlib android 1.2.0, https://www.kvaser.com/download/). I have the source code for the library, and I was able to build it in Android Studio, to generate the aar. The android studio project consists of an app, as well as the library. The provided app seems to run well enough and calls the library without trouble.

I'd like to use the AAR from a MAUI app. I created an "Android Java Library Binding" for the AAR, and it seems to build ok. I can see everything I expect in the vs2022 object explorer. When I first go to use the library from a MAUI app, I get an exception of "Java.Lang.NoClassDefFoundError", "Failed resolution of: Landroid/support/v4/util/SimpleArrayMap".

From some Googling, my best guess is that it might be a problem with the android support library v4 (or lack thereof)? I tried to add Xamarin.Support.v4 nuget package, but got yet more exotic errors with low google search results (MSB4018, The "VerifyVersionsTask" task failed unexpectedly).

The AAR's android studio project was set up with the following sdk versions:

compileSdkVersion = 23
targetSdkVersion = 23
buildToolsVersion = "28.0.3"
minSdkVersionCanLib = 12
minSdkVersionApp = 16

Also, in the android studio project dependancies:

api 'com.android.support:appcompat-v7:23.1.1'
api 'com.android.support:support-annotations:23.1.1'

The android studio project, upon first opening form Kvaser's website, prompted me to upgrade gradle multiple times, until it seemed happy enough to build at V5.4.1.

My vs2022 version: Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.3.0 Preview 1.1

I've tried lots of things but I'm not sure how much or relevant to describe here. Please let me know if I've missed anything that would be helpful. Anyone have any ideas on how to fix this NoClassDefFoundError?

I've posted this question also to the .net maui github discussion board at https://github.com/dotnet/maui/discussions/7652, where I've also attached my source code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文