架构x86_64未定义的符号:"_OBJC_CLASS_$_GNSMessageManager" - flutter应用中的iOS的NearBy原生开发。

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

只是试图在flutter应用中建立本地的附近抛出错误。

架构x86_64未定义的符号:"_OBJC_CLASS_$_GNSMessageManager",引用自:AppDelegate.old中的objc-class-ref:未找到架构x86_64clang的符号:错误:链接器命令失败,退出代码1(使用-v查看调用)

我试着改变构建设置架构和构建阶段与库链接的二进制文件,但对我来说没有任何效果。

Info.plist文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>elsetestsd</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMicrophoneUsageDescription</key>
    <string>The microphone listens for anonymous tokens from nearby devices.</string>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>

只需在我的应用程序委托中加入一段代码即可。

#import "AppDelegate.h"
#import <GNSMessages.h>
#import "GeneratedPluginRegistrant.h"

@interface AppDelegate ()

@property(nonatomic) GNSMessageManager *messageManager;
@end

荚文件

# Uncomment the next line to define a global platform for your project
 platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'Runner' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  # Pods for Runner
  pod 'NearbyMessages'
end
ios xcode flutter google-nearby google-nearby-messages
1个回答
1
投票

看来你是想在模拟器上测试,但你使用的二进制库并没有包含arch x86_64。

要么找到或向他们申请一个通用库,要么在iOS设备上测试你的应用程序,我猜他们确实支持iOS设备(无论是armv7还是arm64)。

© www.soinside.com 2019 - 2024. All rights reserved.