在Visual Studio的NuGet为Xamarin.Android Androidx库

问题描述 投票:0回答:1

是qazxsw POI库在Visual Studio的NuGet包管理器可用?

我的应用程序的目标是Android的p之间,这样我可以使用Android Studio中的androidx库,但在我的NuGet无法找到他们。

随着Android的工作室,我可以使用:

androidx

但投在Visual Studio例外:

<androidx.constraintlayout.widget.ConstraintLayout

那么,有没有使用与Xamarin.Android的02-09 21:31:59.970 I/MonoDroid( 8843): UNHANDLED EXCEPTION: 02-09 21:32:00.137 I/MonoDroid( 8843): Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout ---> Java.Lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.ConstraintLayout" on path: DexPathList[[zip file "/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk"],nativeLibraryDirectories=[/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/lib/x86, /data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk!/lib/x86, /system/lib]] 02-09 21:32:00.137 I/MonoDroid( 8843): --- End of inner exception stack trace --- 02-09 21:32:00.137 I/MonoDroid( 8843): --- End of inner exception stack trace --- 02-09 21:32:00.137 I/MonoDroid( 8843): at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <8acc8089c2ed40d08469fbaa6710a44c>:0 02-09 21:32:00.137 I/MonoDroid( 8843): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <8acc8089c2ed40d08469fbaa6710a44c>:0 02-09 21:32:00.137 I/MonoDroid( 8843): at Android.App.Activity.SetContentView (System.Int32 layoutResID) [0x00022] in <957bbfdfda4341e2939c881206c1140a>:0 02-09 21:32:00.137 I/MonoDroid( 8843): at Keystore.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00009] in H:\My Projects\Android\Samples\Keystore\MainActivity.cs:19 02-09 21:32:00.137 I/MonoDroid( 8843): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <957bbfdfda4341e2939c881206c1140a>:0 02-09 21:32:00.138 I/MonoDroid( 8843): at (wrapper dynamic-method) System.Object.3(intptr,intptr,intptr) 02-09 21:32:00.138 I/MonoDroid( 8843): --- End of managed Android.Views.InflateException stack trace --- 02-09 21:32:00.138 I/MonoDroid( 8843): android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout 02-09 21:32:00.138 I/MonoDroid( 8843): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout 02-09 21:32:00.138 I/MonoDroid( 8843): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.ConstraintLayout" on path: DexPathList[[zip file "/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk"],nativeLibraryDirectories=[/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/lib/x86, /data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk!/lib/x86, /system/lib]] 02-09 21:32:00.138 I/MonoDroid( 8843): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 02-09 21:32:00.138 I/MonoDroid( 8843): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 02-09 21:32:00.138 I/MonoDroid( 8843): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.createView(LayoutInflater.java:606) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 02-09 21:32:00.138 I/MonoDroid( 8843): at md561c0eefc2ba1e38323457d81b00d3caf.MainActivity.n_onCreate(Native Method) 02-09 21:32:00.138 I/MonoDroid( 8843): at md561c0eefc2ba1e38323457d81b00d3caf.MainActivity.onCreate(MainActivity.java:31) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.Activity.performCreate(Activity.java:7136) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.Activity.performCreate(Activity.java:7127) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 02-09 21:32:00.139 I/MonoDroid( 8843): at android.os.Handler.dispatchMessage(Handler.java:106) 02-09 21:32:00.139 I/MonoDroid( 8843): at android.os.Looper.loop(Looper.java:193) 02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.ActivityThread.main(ActivityThread.java:6669) 02-09 21:32:00.139 I/MonoDroid( 8843): at java.lang.reflect.Method.invoke(Native Method) 02-09 21:32:00.139 I/MonoDroid( 8843): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 02-09 21:32:00.139 I/MonoDroid( 8843): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 库的方法吗?

android visual-studio xamarin.android nuget androidx
1个回答
0
投票

你无法找到它的原因是因为你不能有它的NuGet

我们需要添加androidx包,支持ConstraintLayout我们Xamarin.Android项目。所以要加这个包右键点击

包>添加软件包。 //苹果电脑

参考文献 - >管理的NuGet软件包//视窗

搜索Xamarin.Android.Support.Constraint.Layout并接受许可证添加软件包。

并使用XML以下命名空间ConstraintLayout

更新

在我的知识<android.support.constraint.ConstraintLayout>是Mono.Droid不可用,因此你可能需要将其绑定到一个AAR,然后使用该AAR做出<androidx.constraintlayout.widget.ConstraintLayout解决这个问题发生的同时使该绑定的问题,然后用它到你的Droid项目作为。 DLL


0
投票
© www.soinside.com 2019 - 2024. All rights reserved.