maui - Undefined symbols for architecture arm64 - Native Library Interop - Stack Overflow

I'm building a MAUI app that includes a NativeLibraryInterop based closely on the Firebase sample.

I'm building a MAUI app that includes a NativeLibraryInterop based closely on the Firebase sample.

The NativeLibraryInterop project builds successfully. However, when I build the apps project itself, I get a bunch of errors related to the interfaces.

clang++ exited with code 1:
// a path
"OBJC_CLASS$_MauiFIRApp", referenced from:
// a path
error : Undefined symbols for architecture arm64:

How do I fix this?

I'm building a MAUI app that includes a NativeLibraryInterop based closely on the Firebase sample.

The NativeLibraryInterop project builds successfully. However, when I build the apps project itself, I get a bunch of errors related to the interfaces.

clang++ exited with code 1:
// a path
"OBJC_CLASS$_MauiFIRApp", referenced from:
// a path
error : Undefined symbols for architecture arm64:

How do I fix this?

Share Improve this question asked Mar 19 at 17:58 tonyedwardspztonyedwardspz 1,9202 gold badges25 silver badges49 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Add the [Protocol] attribute to each interface that is referenced in the "Undefined symbols for architecture arm64" errors.

From:

[BaseType (typeof(NSObject))]
interface MauiFIRApp
{
    // Interface code
}

To:

[Protocol]
[BaseType (typeof(NSObject))]
interface MauiFIRApp
{
    // Interface code
}

Then rebuild your NativeLibraryInterop project. If migrating between .Net versions / xcode versions, you might need to rebuild the native library as well

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744440161a4574310.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信