我需要将Firebase的防火墙功能添加到我的应用程序(后台UWP应用程序)中,该应用程序运行在运行Windows 10 IOT Core的raspberry (ARM)上。
我设法让这个应用程序在我的电脑上完全正常工作(里面有火药库),并将它部署到树莓上,但当应用程序启动时,我得到了一个错误:
Error: Value cannot be null. Parameter name: path1
at System.IO.Path.Combine(String, String) + 0x2c
at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary() + 0x36
at Grpc.Core.Internal.NativeExtension.LoadNativeMethods() + 0x28
at Grpc.Core.Internal.NativeExtension..ctor() + 0x12
at Grpc.Core.Internal.NativeExtension.Get() + 0x4a
at Grpc.Core.GrpcEnvironment.GrpcNativeInit() + 0x48
at Grpc.Core.GrpcEnvironment..ctor() + 0x64
at Grpc.Core.GrpcEnvironment.AddRef() + 0x54
at Grpc.Core.Channel..ctor(String, ChannelCredentials, IEnumerable`1) + 0xa8
at Google.Api.Gax.Grpc.GrpcCore.GrpcCoreAdapter.CreateChannelImpl(String, ChannelCredentials, GrpcChannelOptions) + 0x24
at Google.Api.Gax.Grpc.GrpcAdapter.CreateChannel(String, ChannelCredentials, GrpcChannelOptions) + 0x16
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(GrpcAdapter, String, GrpcChannelOptions, ChannelCredentials) + 0x58
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(GrpcAdapter, String, GrpcChannelOptions) + 0x1a8
at Google.Api.Gax.Grpc.ClientBuilderBase`1.CreateCallInvoker() + 0x5e
at Google.Cloud.Firestore.V1.FirestoreClientBuilder.BuildImpl() + 0x16
at Google.Cloud.Firestore.FirestoreDbBuilder.Build() + 0x1ee
at Google.Cloud.Firestore.FirestoreDb.Create(String, FirestoreClient) + 0x1bc
at Processing.Service.Firestore.<Initialize>d__22.MoveNext() + 0xc4我尝试取消检查“使用.net原生工具链编译”项目选项,但现在我得到了以下错误:
Error loading native library "C:\Data\Programs\WindowsApps\Service_1.1.94.0_arm\grpc_csharp_ext.x86.dll".
at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary()
at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
...
at Google.Cloud.Firestore.V1.FirestoreClientBuilder.BuildImpl()
at Google.Cloud.Firestore.FirestoreDbBuilder.Build()
at Google.Cloud.Firestore.FirestoreDb.Create(String projectId, FirestoreClient client)在这两种情况下,我收到了224条警告:
ILTransform : warning ILT0028: Found native library 'W:\Service\obj\ARM\Release\ilc\in\grpc_csharp_ext.x64.dll' with unexpected CPU architecture 'amd64', while the current build target architecture is set to 'arm'. Your application may fail to launch. Please make sure to build your application with the matching CPU architecture. Service
ILTransform : warning ILT0028: Found native library 'W:\Service\obj\ARM\Release\ilc\in\grpc_csharp_ext.x86.dll' with unexpected CPU architecture 'x86', while the current build target architecture is set to 'arm'. Your application may fail to launch. Please make sure to build your application with the matching CPU architecture. Service
MCG : warning MCG0007: Unresolved P/Invoke method 'grpc_csharp_ext!gprsharp_convert_clock_type' for method 'Grpc.Core.Internal.Timespec Grpc.Core.Internal.NativeMethods.DllImportsFromSharedLib.gprsharp_convert_clock_type(Grpc.Core.Internal.Timespec, Grpc.Core.Internal.ClockType)'. Calling this method would throw exception at runtime. Please make sure the P/Invoke either points to a Windows API allowed in UWP applications, or a native DLL that is part of the package. If for some reason your P/Invoke does not satisfy those requirements, please use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP APIs. Service
MCG : warning MCG0007: Unresolved P/Invoke method 'grpc_csharp_ext!gprsharp_free' for method 'System.Void Grpc.Core.Internal.NativeMethods.DllImportsFromSharedLib.gprsharp_free(System.IntPtr)'. Calling this method would throw exception at runtime. Please make sure the P/Invoke either points to a Windows API allowed in UWP applications, or a native DLL that is part of the package. If for some reason your P/Invoke does not satisfy those requirements, please use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP APIs. Service 备注:
设备上存在json配置文件和所需的环境变量。使用Windows10IOTCore和UWP应用程序使用“application”(*.appxbundle)
我试过:
project.
想法:
Google.Cloud.Firestore
)
我需要建议,建议,想法.如果有人能帮忙的话,那就太棒了!
谢谢
发布于 2020-11-23 15:10:27
问题在于,您正试图在基于ARM的平台上使用Grpc.Core。Grpc.Core在内部依赖于本机库(grpc_csharp_ext),而Grpc.Core包并没有提供该库的ARM构建版本,因此您所要做的工作将无法实现。
你能做的是:
https://stackoverflow.com/questions/64846353
复制相似问题