英文:
error when running cmd flutter build ipa since android studio update
问题
我最近将Android Studio升级到Flamingo | 2022.2.1 Patch 2,然后更新了Flutter及其所有包。
以前,在Android Studio终端中运行flutter build ipa
时,它可以顺利构建我的应用的.ipa文件。现在我已经升级了Android Studio,当我运行flutter build ipa
时,出现了以下错误:
development@NC-MBP my_app % flutter build ipa
Archiving com.crossfiregames.my_app...
Signing iOS app for device deployment using developer identity: "Apple Development: NC (XKJ4653QSG)"
Running pod install... 299ms
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
[!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`, did find `Runner`.
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer/target_inspector.rb:108:in `compute_targets'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer/target_inspector.rb:40:in `compute_results'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1197:in `block (3 levels) in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1195:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1195:in `block (2 levels) in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:107:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:422:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:162:in `install!'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `<main>'
Error running pod install
我尝试搜索给出的错误信息,[!] Unable to find a target named RunnerTests
in project Runner.xcodeproj
, did find Runner
,但没有找到太多相关信息。有人之前遇到过这个问题吗?如果是的话,请告诉我如何解决,因为我是Flutter新手,不太了解这个问题。谢谢!
英文:
I recently updated android studio to Flamingo | 2022.2.1 Patch 2 and the followed by updating Flutter and all of its packages.
previously, when I ran flutter build ipa in the terminal in android studio, it would build my apps .ipa without any trouble. now that I've updated android studio I'm getting the below error when i run flutter build ipa.
`development@NC-MBP my_app % flutter build ipa
Archiving com.crossfiregames.my_app...
Signing iOS app for device deployment using developer identity: "Apple Development: NC (XKJ4653QSG)"
Running pod install... 299ms
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
[!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`, did find `Runner`.
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer/target_inspector.rb:108:in `compute_targets'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer/target_inspector.rb:40:in `compute_results'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1197:in `block (3 levels) in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1195:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1195:in `block (2 levels) in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:107:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:422:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:162:in `install!'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `<main>'
Error running pod install`
I tried searching for the error that it is giving me, [!] Unable to find a target named RunnerTests
in project Runner.xcodeproj
, did find Runner
.
but cannot find much info about it. has anyone had this trouble before? and if so, how do i go ahead and fix it please? I'm new to flutter and this is beyond me.
thanks so much
答案1
得分: 0
作为一种解决方法,我通常运行 flutter clean
。
如果这不起作用,运行 rm -r ios
然后运行 flutter create --platforms=ios
,这将重新创建 iOS 目录。如果您仍然无法构建,请在 github.com/flutter/flutter/issues/new/choose 提交一个问题。
英文:
As a workaround, I typically flutter clean
.
If that doesn't work, rm -r ios
and flutter create --platforms=ios
, which recreates the iOS directory. If you still can't build, please file an issue at github.com/flutter/flutter/issues/new/choose
答案2
得分: 0
根据错误消息,似乎存在与项目 CocoaPods 配置有关的问题。在这种情况下,让我们尝试以下步骤:
-
从终端,在项目的根目录中运行
pod repo update
如果没有安装 CocoaPods,请运行
sudo gem install cocoapods
。
-
接下来,通过运行以下命令重新安装 CocoaPods 依赖项:
rm ios/Podfile.lock rm -rf ios/Pods pod install --project-directory=ios
这将删除现有的 Podfile.lock
文件以及 "Pods" 目录,从而重新安装 CocoaPods 依赖项。
最后,运行 flutter build ipa
。
英文:
According to the error message, it seems that there is an issue with the project CocoaPods configuration. In this case, let's try the following steps:
-
From the terminal, in the root directory of the project run
pod repo update
<sub>In case of not having CocoaPods installed, run
sudo gem install cocoapods
.</sub>
<br/>
-
Next, reinstall the CocoaPods dependencies, by running the following commands:
rm ios/Podfile.lock rm -rf ios/Pods pod install --project-directory=ios
They remove the existing Podfile.lock
file, the "Pods" directory thus reinstalling the CocoaPods dependencies.
Finally, run flutter build ipa
.
答案3
得分: 0
在Podfile中,您需要找到以下文本:
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
# target 'RunnerTests' do
# inherit! :search_paths
# end
end
然后将已注释掉的部分用注释符号(#)注释掉,然后它将像往常一样构建。
英文:
Ok, found out how to fix it. in the podfile, you need to find the below text,
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
# target 'RunnerTests' do
# inherit! :search_paths
# end
end
and then comment out (#) the parts that are commented out. then it will build as usual
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论