最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin3浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论