Flutter/macOS - 应用程序仍然包含默认的签名标识符

Posted

技术标签:

【中文标题】Flutter/macOS - 应用程序仍然包含默认的签名标识符【英文标题】:Flutter/macOS - Application still contains the default signing identifier 【发布时间】:2019-02-13 03:07:59 【问题描述】:

我最近将一些文件从旧的 Flutter 项目中的 ios 文件夹复制到了一个新项目中,以便我可以保留 appIconslaunchScreens。现在,当我尝试从 VSCode 启动我的代码时出现以下错误,Xcode 工作正常

我想知道是否有一种方法可以更改某些参数,以便可以替换我的签名 ID,但我在 Xcode 中找不到任何地方可以这样做。

(诺基亚 3310 只是我用于调试测试的 iPhone 6 :))

Launching lib/main.dart on Nokia 3310 in debug mode...
    Automatically signing iOS for device deployment using specified development team in Xcode project: **********
    Xcode build done.
    Failed to build iOS app
    Error output from Xcode build:
    ↳
    ** BUILD FAILED **
    Xcode's output:
    ↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    Target 'Pods-Runner' of project 'Pods' was rejected as an implicit dependency for 'libPods-Runner.a' because its architectures 'arm64' didn't contain all required architectures 'armv7 arm64'
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/main.m:1:
    In file included from <module-includes>:1:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
    /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:80:42: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
    didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
    ^
    In module 'UIKit' imported from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:43:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
    @interface UIUserNotificationSettings : NSObject
    ^
    While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/main.m:1:
    In file included from <module-includes>:1:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
    /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
    completionHandler:(nonnull void (^)())completionHandler;
    ^
    void
    2 warnings generated.
    2 warnings generated.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/AppDelegate.h:1:
    In file included from <module-includes>:1:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
    /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:80:42: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
    didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
    ^
    In module 'UIKit' imported from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:43:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
    @interface UIUserNotificationSettings : NSObject
    ^
    While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/AppDelegate.h:1:
    In file included from <module-includes>:1:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
    In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
    /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
    completionHandler:(nonnull void (^)())completionHandler;
    ^
    void
    2 warnings generated.
    2 warnings generated.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    ld: warning: directory not found for option '-F/Users/jake/Desktop/cryptick-master/ios/Pods/../.symlinks/flutter/ios'
    ld: library not found for -lPods-Runner
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ld: warning: directory not found for option '-F/Users/jake/Desktop/cryptick-master/ios/Pods/../.symlinks/flutter/ios'
    ld: library not found for -lPods-Runner
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Could not build the precompiled application for the device.
    It appears that your application still contains the default signing identifier.
    Try replacing 'com.example' with your signing id in Xcode:
      open ios/Runner.xcworkspace
    Error launching application on Nokia 3310.
    Exited (sigterm)

【问题讨论】:

这不是一个答案,而是一个 FWIW:我发现以下包在处理图标时很有帮助(至于启动屏幕,我通常使用 Xcode 的拖放界面):@987654321 @ 感谢您的评论,我有一个图标和启动屏幕的工作文件。在这种情况下,主要是我删除了我替换的旧文件,所以我不能回去从头开始。这个包看起来不错,虽然我会把它放在书签里:) 2 年后,我也面临这个问题。你解决了吗? @lucasjr 我要再看看这个并尝试找到一个可靠的答案,与此同时,我想我刚刚开始了一个新项目,通过复制我的代码迁移了我的代码、图标等用我想要的资产重建我的 appIconslaunchScreens 目录。 【参考方案1】:

看来问题已通过再次创建新项目并迁移代码得到解决。根据当前的详细信息,我无法最终复制此问题。

如果其他人遇到类似问题,请提供复制行为的步骤并在此处归档:https://github.com/flutter/flutter/issues/ 

【讨论】:

以上是关于Flutter/macOS - 应用程序仍然包含默认的签名标识符的主要内容,如果未能解决你的问题,请参考以下文章

MacOS安装flutter(MacOS下flutter环境配置)

Flutter |macOS 下载安装配置

Flutter |macOS 下载安装配置

PHP使用命名空间:别名/导入(Aliasing/Importing)

Python入门总结-默单词程序

包含头文件,但仍然无法调用函数