Flutter project on Mac (copied from Windows)

6,408

Solution 1

This worked for me:

1) Create a new flutter project. 2) Run the project and ensure it runs smoothly. 3) Once you verify that the project runs, go to your new project in :

  • ProjectDirecectory
  • iOS folder

Copy the following:

Runner.xcodeproj and Runner.xcworkspace

Paste these into your old project (Project/ios) then save and run. This worked for me and hope it will help.

Solution 2

I got a similar error as the following:

      Expected ios/Runner.xcodeproj/project.pbxproj 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.

Problem was that I cloned the project from a Git Repository. project.pbxproj file was in .gitignore. So, I created a new flutter project and copied other files into this.

enter image description here

Share:
6,408
user12607260
Author by

user12607260

Updated on December 16, 2022

Comments

  • user12607260
    user12607260 over 1 year

    I received Flutter project from friend to build iOS version of the app on the Mac (Catalina & Xcode 11.3). The Flutter project is made in Windows and made for Android. Now I should make iOS version on Mac of the same project.

    I and my friend are very new to Flutter. I have little experience of Xcode (building exported Unity projects).

    I want to understand what Flutter needs to be working. I can create test project and run it in the simulator. But this project doesn't work.

    Output of flutter doctor -v seems to be fine:

    [✓] 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!
    

    I try to clean build folder and re-create the project:

    flutter clean flutter create .

    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/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]
      (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/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      g (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      g (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
      (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
    

    I even tried to copy files from test project to TestApp folders, but that doesn't worked.

    Should I configure the TestApp project to iOS project? I don't have Brew installed. Should I install that and something else?

    Any ideas?

    • Slah Layouni
      Slah Layouni over 4 years
      Try running flutter create . in the projet folder.
    • smorgan
      smorgan over 4 years
      Is the project an application, or a plugin? The flutter create output shows it creating files for a plugin, not an application, but you are trying to run it as if it were an application.
    • Muraino
      Muraino almost 3 years
      Some files are missing perhaps deleted Run flutter create ios