Flutter-Codemagic-iOS构建失败

如何解决Flutter-Codemagic-iOS构建失败

我正在尝试为Flutter制作的IOS构建应用。

我没有Mac设备可以完成这项工作,因此我正尝试从codemagic.io生成IPA文件。

我为Apple Developer Program创建了一个帐户并支付了账单。

我遵循了使用Codemagic的说明,包括iOS代码签名的说明:https://docs.codemagic.io/code-signing/ios-code-signing/

我在GitHub上创建了一个存储库,并生成了一个配置文件(codemagic.yaml)。

因此,当我尝试构建我的应用程序(发行版)时,出现以下问题:

Building iOS
1m 23s




== Building for iOS ==


> /usr/local/bin/flutter build ios --release --no-codesign

/Users/builder/clone/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 44 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building fr.remax.franckehrart for device (ios-release)...

Project base configurations detected,removing.

Running pod install...                                          
    6.2s

/Users/builder/clone/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 44 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
Running Xcode build...                                          

Xcode build done.                                           48.3s

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    ../programs/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.3.2/lib/src/components/selection_controls.dart:182:10: Error: The method '_NeuSelectionControls.buildToolbar' has fewer positional arguments than those of overridden method 'TextSelectionControls.buildToolbar'.
      Widget buildToolbar(
             ^
    ../programs/flutter/packages/flutter/lib/src/widgets/text_selection.dart:136:10: Context: This is the overridden method ('buildToolbar').
      Widget buildToolbar(
             ^
    ../programs/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.3.2/lib/src/components/selection_controls.dart:222:59: Error: Too few positional arguments: 2 required,1 given.
              handleCopy: canCopy(delegate) ? () => handleCopy(delegate) : null,^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Encountered error while building for device.




Build failed :|
Failed to build for iOS

我不明白。代码签名有问题吗?

在我的Apple开发者帐户中,我可以看到已生成证书。

关于Codemagic的上一步似乎还可以:

== Fetch code signing files from Apple Developer Portal ==

Automatically detected bundle identifier "fr.remax.franckehrart" from project

Fetch App Store signing files for bundle identifier "fr.remax.franckehrart"

Initializing Apple Developer Portal session with david.matoska@gmail.com

Using Apple Developer Portal team david matoska (HBD2Z7384F) to fetch signing files

Found App ID "fr remax franckehrart" for bundle identifier "fr.remax.franckehrart"

Found code signing certificate "Apple Push Services: fr.remax.franckehrart"
Found code signing certificate "iOS Distribution: david matoska"

Found iOS Distribution provisioning profile "fr remax franckehrart app_store 1597698130"


> keychain initialize

Initialize new keychain to store code signing certificates at /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Create keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain

Set keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain timeout to "no timeout"

Set keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain to system default keychain
Unlock keychain /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain



> keychain add-certificates --certificate /tmp/aps_uiasoh6i.p12 --certificate-password @env:CERTIFICATE_PASSWORD

Add certificates to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Searching for files matching /tmp/aps_uiasoh6i.p12
Add certificate /tmp/aps_uiasoh6i.p12 to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain

1 identity imported.



> keychain add-certificates --certificate /tmp/ios_distribution_ln2czakc.p12 --certificate-password @env:CERTIFICATE_PASSWORD

Add certificates to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain
Searching for files matching /tmp/ios_distribution_ln2czakc.p12
Add certificate /tmp/ios_distribution_ln2czakc.p12 to keychain /private/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/build_4qw6y93s.keychain

1 identity imported.



== Install Flutter dependencies ==

> /usr/local/bin/flutter packages pub get

Resolving dependencies...

> async 2.4.2 (was 2.4.1) (2.5.0-nullsafety available)
+ characters 1.0.0 (1.1.0-nullsafety.2 available)
+ clock 1.0.1 (1.1.0-nullsafety available)
> collection 1.14.13 (was 1.14.12) (1.15.0-nullsafety.2 available)
+ fake_async 1.1.0 (1.2.0-nullsafety available)
> matcher 0.12.8 (was 0.12.6) (0.12.9 available)
> path 1.7.0 (was 1.6.4) (1.8.0-nullsafety available)
> stack_trace 1.9.5 (was 1.9.3) (1.10.0-nullsafety available)
> test_api 0.2.17 (was 0.2.15) (0.2.18 available)
> typed_data 1.2.0 (was 1.1.6) (1.3.0-nullsafety.2 available)
These packages are no longer being depended on:
- quiver 2.1.3

Downloading flutter_rename_app 1.0.0...
Downloading flutter_launcher_icons 0.7.5...
Downloading neumorphic 0.3.2...
Downloading curved_navigation_bar 0.3.3...
Downloading ansicolor 1.0.2...
Downloading process_run 0.10.12+1...
Downloading image 2.1.12...
Downloading xml 3.6.1...
Downloading petitparser 2.4.0...
Downloading crypto 2.1.4...

Changed 11 dependencies!

你能帮我吗?

解决方法

所以...奏效了:) !!!!!!

我必须更改pubspec.yaml文件。

我选择了0.4.0版本的Neumorphic(相对于0.3.2版本)。

@Captivity,再次感谢您对info.plist文件的帮助。

再见。

,

谢谢您,

这是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>$(DEVELOPMENT_LANGUAGE)</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>Franck Ehrhart</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>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <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>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>

    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>whatsapp</string>
    </array>

    <false/>
</dict>
</plist>

,

Okey,您的“键” UIViewControllerBasedStatusBarAppearance没有分配的值。

,

所以,我更改了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>$(DEVELOPMENT_LANGUAGE)</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>Franck Ehrhart</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>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <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>
    </array>
        <key>UIViewControllerBasedStatusBarAppearance</key>
        <true/>

    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>whatsapp</string>
    </array>


</dict>
</plist>

我仍然有构建错误。

这次我真的不知道为什么它不起作用。 Neumorphic Flutter软件包真的是为iOS制作的吗?

== Building for iOS ==


> /usr/local/bin/flutter build ios --release --no-codesign

Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building fr.remax.franckehrart for device (ios-release)...

Project base configurations detected,removing.

Running pod install...                                          
    5.7s

Running Xcode build...                                          

Xcode build done.                                           67.7s

Failed to build iOS app

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    ../programs/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.3.2/lib/src/components/selection_controls.dart:182:10: Error: The method '_NeuSelectionControls.buildToolbar' has fewer positional arguments than those of overridden method 'TextSelectionControls.buildToolbar'.
      Widget buildToolbar(
             ^
    ../programs/flutter/packages/flutter/lib/src/widgets/text_selection.dart:136:10: Context: This is the overridden method ('buildToolbar').
      Widget buildToolbar(
             ^
    ../programs/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.3.2/lib/src/components/selection_controls.dart:222:59: Error: Too few positional arguments: 2 required,1 given.
              handleCopy: canCopy(delegate) ? () => handleCopy(delegate) : null,^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Encountered error while building for device.




Build failed :|
Failed to build for iOS

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-