gpt4 book ai didi

xcode - Mac 上的 Flutter 项目(从 Windows 复制过来的)

转载 作者:行者123 更新时间:2023-12-01 21:50:37 29 4
gpt4 key购买 nike

我从 friend 那里收到了 Flutter 项目,用于在 Mac(Catalina 和 Xcode 11.3)上构建应用程序的 iOS 版本。 Flutter 项目是在 Windows 中开发的,也是为 Android 开发的。现在我应该在同一项目的 Mac 上制作 iOS 版本。

我和我的 friend 是 Flutter 的新手。我对 Xcode(构建导出的 Unity 项目)经验不多。

我想了解 Flutter 需要做什么。我可以创建测试项目并在模拟器中运行它。但是这个项目行不通。

flutter doctor -v 的输出似乎没问题:

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57,
locale en-GB)
• Flutter version 1.12.13+hotfix.5 at
/Users/donkeygames/Development/Flutter/flutter
• Framework revision 27321ebbad (2 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/donkeygames/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3, Build version 11C29
• CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
• iPhone 11 Pro Max • 41E09B8C-2D5A-4F0E-8557-2C93BE37B6E6 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

• No issues found!

我尝试清理构建文件夹并重新创建项目:

flutter 干净 flutter 创造。

Recreating project ....
ios/.gitignore (created)
ios/Assets/.gitkeep (created)
ios/alylatu.podspec (created)
ios/Classes/TestAppPlugin.m (created)
ios/Classes/SwiftTestAppPlugin.swift (created)
ios/Classes/TestAppPlugin.h (created)
example/ios/Runner.xcworkspace/contents.xcworkspacedata (created)
example/ios/Runner/Info.plist (created)
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
(created)
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
(created)
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (created)
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
(created)
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.pn
g (created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.pn
g (created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
(created)
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
(created)
example/ios/Runner/Base.lproj/LaunchScreen.storyboard (created)
example/ios/Runner/Base.lproj/Main.storyboard (created)
example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
(created)
example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (created)
example/ios/Flutter/Debug.xcconfig (created)
example/ios/Flutter/Release.xcconfig (created)
example/ios/Flutter/AppFrameworkInfo.plist (created)
example/ios/.gitignore (created)
example/test/widget_test.dart (created)
example/alylatu_example.iml (created)
example/.gitignore (created)
example/.metadata (created)
example/android/app/src/profile/AndroidManifest.xml (created)
example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (created)
example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (created)
example/android/app/src/main/res/drawable/launch_background.xml (created)
example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (created)
example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (created)
example/android/app/src/main/res/values/styles.xml (created)
example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (created)
example/android/app/src/main/AndroidManifest.xml (created)
example/android/app/src/debug/AndroidManifest.xml (created)
example/android/gradle/wrapper/gradle-wrapper.properties (created)
example/android/gradle.properties (created)
example/android/.gitignore (created)
example/android/settings.gradle (created)
example/android/app/build.gradle (created)
example/android/app/src/main/kotlin/com/shahxad/TestApp_example/MainActivity.k
t (created)
example/android/build.gradle (created)
example/android/TestApp_example_android.iml (created)
example/pubspec.yaml (created)
example/README.md (created)
example/ios/Runner/Runner-Bridging-Header.h (created)
example/ios/Runner/AppDelegate.swift (created)
example/ios/Runner.xcodeproj/project.pbxproj (created)
example/lib/main.dart (created)
example/.idea/runConfigurations/main_dart.xml (created)
example/.idea/libraries/Flutter_for_Android.xml (created)
example/.idea/libraries/Dart_SDK.xml (created)
example/.idea/libraries/KotlinJavaRuntime.xml (created)
example/.idea/modules.xml (created)
example/.idea/workspace.xml (created)
Running "flutter pub get" in example... 4.6s

Wrote 74 files.

All done!
[✓] Flutter: is fully installed. (Channel stable, v1.12.13+hotfix.5, on Mac OS X
10.15.2 19C57, locale en-GB)
[✓] Android toolchain - develop for Android devices: is fully installed.
(Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS: is fully installed. (Xcode 11.3)
[✓] Android Studio: is fully installed. (version 3.5)
[✓] Connected device: is fully installed. (1 available)

In order to run your application, type:

$ cd example
$ flutter run

Your application code is in example/lib/main.dart.

Your plugin code is in ./lib/TestApp.dart.

Host platform code is in the "android" and "ios" directories under ..
To edit platform code in an IDE see
https://flutter.dev/developing-packages/#edit-plugin-package.

flutter run lib/TestApp.dart

Launching lib/TestApp.dart on iPhone 11 Pro Max in debug mode...
Expected ios/Runner.xcodeproj but this file is missing.
No application found for TargetPlatform.ios.
Is your project missing an ios/Runner/Info.plist?
Consider running "flutter create ." to create one.

flutter build ios lib/alylatu.dart

Expected ios/Runner.xcodeproj but this file is missing.
Application not configured for iOS

我什至尝试将文件从测试项目复制到 TestApp 文件夹,但这没有用。

我应该将 TestApp 项目配置为 iOS 项目吗?我没有安装 Brew。我应该安装那个和其他东西吗?

有什么想法吗?

最佳答案

这对我有用:

1) 创建一个新的 flutter 项目。2) 运行项目并确保其顺利运行。3) 确认项目运行后,转到您的新项目:

  • 项目目录
  • iOS 文件夹

复制以下内容:

Runner.xcodeproj 和 Runner.xcworkspace

将这些粘贴到您的旧项目 (Project/ios) 中,然后保存并运行。这对我有用,希望它能有所帮助。

关于xcode - Mac 上的 Flutter 项目(从 Windows 复制过来的),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59500596/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com