DenisovAV / flutter_tv

233 stars 40 forks source link

invalid command code R #11

Closed keanallen closed 1 year ago

keanallen commented 1 year ago

I got this error when running the run_apple_tv.sh script


❯ sh scripts/run_apple_tv.sh
+ export FLUTTER_LOCAL_ENGINE=/Volumes/NVME/Development/experiments/custom-flutter-engine/3.10.5
+ FLUTTER_LOCAL_ENGINE=/Volumes/NVME/Development/experiments/custom-flutter-engine/3.10.5
+ fvm flutter clean
Cleaning Xcode workspace...                                      1,308ms
Cleaning Xcode workspace...                                      1,754ms
Deleting build...                                                    1ms
Deleting .dart_tool...                                               2ms
Deleting Generated.xcconfig...                                       0ms
Deleting flutter_export_environment.sh...                            0ms
Deleting Flutter.framework...                                        1ms
Deleting Flutter.podspec...                                          0ms
Deleting ephemeral...                                                0ms
+ fvm flutter pub get
Resolving dependencies...
  _fe_analyzer_shared 22.0.0 (62.0.0 available)
  analyzer 1.7.2 (6.0.0 available)
  args 2.4.0 (2.4.2 available)
  bloc 7.2.1 (8.1.2 available)
  build 2.3.1 (2.4.1 available)
  build_config 1.0.0 (1.1.1 available)
  checked_yaml 2.0.1 (2.0.3 available)
  cli_util 0.3.5 (0.4.0 available)
  collection 1.17.1 (1.18.0 available)
  crypto 3.0.2 (3.0.3 available)
  dart_style 2.1.1 (2.3.2 available)
  file 6.1.4 (7.0.0 available)
  flutter_bloc 7.3.3 (8.1.3 available)
  glob 2.1.1 (2.1.2 available)
  json_annotation 4.1.0 (4.8.1 available)
  json_serializable 4.1.4 (6.7.1 available)
  logging 1.1.1 (1.2.0 available)
  matcher 0.12.15 (0.12.16 available)
  material_color_utilities 0.2.0 (0.8.0 available)
  pub_semver 2.1.3 (2.1.4 available)
  pubspec_parse 1.1.0 (1.2.3 available)
  source_gen 1.0.3 (1.4.0 available)
  source_span 1.9.1 (1.10.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  test_api 0.5.1 (0.6.1 available)
  typed_data 1.3.1 (1.3.2 available)
  watcher 1.0.2 (1.1.0 available)
  yaml 3.1.1 (3.1.2 available)
Got dependencies!
+ fvm flutter build ios --simulator
Building dev.flutter.tv.flutterTv for simulator (ios)...
Running Xcode build...                                          
Xcode build done.                                            1.6s
Failed to build iOS app
Error output from Xcode build:
↳
    2023-08-02 15:50:01.064 xcodebuild[42749:392985] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
    xcodebuild: error: Unable to find a destination matching the provided destination specifier:
                { generic:1, platform:iOS Simulator }

        Available destinations for the "Runner" scheme:
                { platform:tvOS, id:dvtdevice-DVTiOSDevicePlaceholder-appletvos:placeholder, name:Any tvOS Device }
                { platform:tvOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-appletvsimulator:placeholder, name:Any tvOS Simulator Device }
                { platform:tvOS Simulator, id:29B61D62-BCF7-44C3-8916-61F3E681A86D, OS:16.1, name:Apple TV }
                { platform:tvOS Simulator, id:29B61D62-BCF7-44C3-8916-61F3E681A86D, OS:16.1, name:Apple TV }
                { platform:tvOS Simulator, id:36ED8690-F18C-4DFF-96CA-9DE925C841A9, OS:16.1, name:Apple TV }
                { platform:tvOS Simulator, id:36ED8690-F18C-4DFF-96CA-9DE925C841A9, OS:16.1, name:Apple TV }
                { platform:tvOS Simulator, id:74A54047-87D7-4FA9-B08A-22FC3403E373, OS:16.4, name:Apple TV }
                { platform:tvOS Simulator, id:74A54047-87D7-4FA9-B08A-22FC3403E373, OS:16.4, name:Apple TV }
                { platform:tvOS Simulator, id:502AC92A-E4A3-4B73-9656-321EBDE1E9AD, OS:16.1, name:Apple TV 4K (3rd generation) }
                { platform:tvOS Simulator, id:502AC92A-E4A3-4B73-9656-321EBDE1E9AD, OS:16.1, name:Apple TV 4K (3rd generation) }
                { platform:tvOS Simulator, id:68041DD4-AE6A-4655-A0D0-4AE62E950F71, OS:16.4, name:Apple TV 4K (3rd generation) }
                { platform:tvOS Simulator, id:68041DD4-AE6A-4655-A0D0-4AE62E950F71, OS:16.4, name:Apple TV 4K (3rd generation) }
                { platform:tvOS Simulator, id:DA46ADF4-B7C4-42E4-8B14-124E8620073C, OS:16.1, name:Apple TV 4K (3rd generation) (at 1080p) }
                { platform:tvOS Simulator, id:DA46ADF4-B7C4-42E4-8B14-124E8620073C, OS:16.1, name:Apple TV 4K (3rd generation) (at 1080p) }
                { platform:tvOS Simulator, id:A8D4A7B0-322D-4CB2-A705-41650134704B, OS:16.4, name:Apple TV 4K (3rd generation) (at 1080p) }
                { platform:tvOS Simulator, id:A8D4A7B0-322D-4CB2-A705-41650134704B, OS:16.4, name:Apple TV 4K (3rd generation) (at 1080p) }
                { platform:tvOS Simulator, id:01A2B6BA-1F4F-4CBD-9728-EDAC7EDA2EBB, OS:16.1, name:TV Platform }
                { platform:tvOS Simulator, id:01A2B6BA-1F4F-4CBD-9728-EDAC7EDA2EBB, OS:16.1, name:TV Platform }
                { platform:tvOS Simulator, id:18F33344-7D79-4577-9FC5-BBA02A941215, OS:16.1, name:apol tv }
                { platform:tvOS Simulator, id:18F33344-7D79-4577-9FC5-BBA02A941215, OS:16.1, name:apol tv }

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/r9/4txn5wx12z35sftvb0mt484w0000gn/T/flutter_tools.FLHhex/flutter_ios_build_temp_dir0Zsazo/temporary_xcresult_bundle

Encountered error while building for simulator.
+ sh scripts/switch_target.sh tvos
'_ios' already exists or 'tvos'/'ios' does not exist
+ cd ios
+ fvm flutter pub get
Resolving dependencies in .....
  _fe_analyzer_shared 22.0.0 (62.0.0 available)
  analyzer 1.7.2 (6.0.0 available)
  args 2.4.0 (2.4.2 available)
  bloc 7.2.1 (8.1.2 available)
  build 2.3.1 (2.4.1 available)
  build_config 1.0.0 (1.1.1 available)
  checked_yaml 2.0.1 (2.0.3 available)
  cli_util 0.3.5 (0.4.0 available)
  collection 1.17.1 (1.18.0 available)
  crypto 3.0.2 (3.0.3 available)
  dart_style 2.1.1 (2.3.2 available)
  file 6.1.4 (7.0.0 available)
  flutter_bloc 7.3.3 (8.1.3 available)
  glob 2.1.1 (2.1.2 available)
  json_annotation 4.1.0 (4.8.1 available)
  json_serializable 4.1.4 (6.7.1 available)
  logging 1.1.1 (1.2.0 available)
  matcher 0.12.15 (0.12.16 available)
  material_color_utilities 0.2.0 (0.8.0 available)
  pub_semver 2.1.3 (2.1.4 available)
  pubspec_parse 1.1.0 (1.2.3 available)
  source_gen 1.0.3 (1.4.0 available)
  source_span 1.9.1 (1.10.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  test_api 0.5.1 (0.6.1 available)
  typed_data 1.3.1 (1.3.2 available)
  watcher 1.0.2 (1.1.0 available)
  yaml 3.1.1 (3.1.2 available)
Got dependencies in ..!
+ pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig` in your build configuration (`Flutter/Generated.xcconfig`).

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
+ sh ../scripts/copy_framework.sh debug_sim FLUTTER_LOCAL_ENGINE
Coping Flutter.framework (debug-simulator)...
+ sed -i 's#FLUTTER_LOCAL_ENGINE[[:space:]]=[[:space:]].*;#FLUTTER_LOCAL_ENGINE = "/Volumes/NVME/Development/experiments/custom-flutter-engine/3.10.5";#g' Runner.xcodeproj/project.pbxproj
sed: 1: "Runner.xcodeproj/projec ...": invalid command code R
+ open Runner.xcworkspace

Note: I'm using mac mini m1

DenisovAV commented 1 year ago

Try to remove the folder, and clone from scratch before run script

keanallen commented 1 year ago

i got this message: Built /Volumes/NVME/Development/example/flutter_tv/build/ios/iphonesimulator/Runner.app.

DenisovAV commented 1 year ago

Can you share the whole trace when you run scripts for the first time after cloning? The previous stack trace is not first launch

keanallen commented 1 year ago

Sure.

❯ sh scripts/run_apple_tv.sh
+ export FLUTTER_LOCAL_ENGINE=/Volumes/NVME/Development/experiments/custom-flutter-engine/3.10.5
+ FLUTTER_LOCAL_ENGINE=/Volumes/NVME/Development/experiments/custom-flutter-engine/3.10.5
+ fvm flutter clean
Cleaning Xcode workspace...                                      1,971ms
Cleaning Xcode workspace...                                      1,786ms
Deleting .dart_tool...                                               1ms
Deleting Generated.xcconfig...                                       0ms
Deleting flutter_export_environment.sh...                            0ms
Deleting ephemeral...                                                0ms
+ fvm flutter pub get
Resolving dependencies...
  _fe_analyzer_shared 22.0.0 (62.0.0 available)
  analyzer 1.7.2 (6.0.0 available)
  args 2.4.0 (2.4.2 available)
  bloc 7.2.1 (8.1.2 available)
  build 2.3.1 (2.4.1 available)
  build_config 1.0.0 (1.1.1 available)
  checked_yaml 2.0.1 (2.0.3 available)
  cli_util 0.3.5 (0.4.0 available)
  collection 1.17.1 (1.18.0 available)
  crypto 3.0.2 (3.0.3 available)
  dart_style 2.1.1 (2.3.2 available)
  file 6.1.4 (7.0.0 available)
  flutter_bloc 7.3.3 (8.1.3 available)
  glob 2.1.1 (2.1.2 available)
  json_annotation 4.1.0 (4.8.1 available)
  json_serializable 4.1.4 (6.7.1 available)
  logging 1.1.1 (1.2.0 available)
  matcher 0.12.15 (0.12.16 available)
  material_color_utilities 0.2.0 (0.8.0 available)
  pub_semver 2.1.3 (2.1.4 available)
  pubspec_parse 1.1.0 (1.2.3 available)
  source_gen 1.0.3 (1.4.0 available)
  source_span 1.9.1 (1.10.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  test_api 0.5.1 (0.6.1 available)
  typed_data 1.3.1 (1.3.2 available)
  watcher 1.0.2 (1.1.0 available)
  yaml 3.1.1 (3.1.2 available)
Got dependencies!
+ fvm flutter build ios --simulator
Building dev.flutter.tv.flutterTv for simulator (ios)...
Updating minimum iOS deployment target to 11.0.
Upgrading project.pbxproj
Upgrading AppFrameworkInfo.plist
Updating project for Xcode compatibility.
Upgrading project.pbxproj
Upgrading Runner.xcscheme
Upgrading Info.plist
Removing script build phase dependency analysis.
Adding input path to Thin Binary build phase.
Running Xcode build...                                          
Xcode build done.                                           18.5s
Built /Volumes/NVME/Development/example/flutter_tv/build/ios/iphonesimulator/Runner.app.
+ sh scripts/switch_target.sh tvos
switching to 'tvos' 
+ cd ios
+ fvm flutter pub get
Resolving dependencies in .....
  _fe_analyzer_shared 22.0.0 (62.0.0 available)
  analyzer 1.7.2 (6.0.0 available)
  args 2.4.0 (2.4.2 available)
  bloc 7.2.1 (8.1.2 available)
  build 2.3.1 (2.4.1 available)
  build_config 1.0.0 (1.1.1 available)
  checked_yaml 2.0.1 (2.0.3 available)
  cli_util 0.3.5 (0.4.0 available)
  collection 1.17.1 (1.18.0 available)
  crypto 3.0.2 (3.0.3 available)
  dart_style 2.1.1 (2.3.2 available)
  file 6.1.4 (7.0.0 available)
  flutter_bloc 7.3.3 (8.1.3 available)
  glob 2.1.1 (2.1.2 available)
  json_annotation 4.1.0 (4.8.1 available)
  json_serializable 4.1.4 (6.7.1 available)
  logging 1.1.1 (1.2.0 available)
  matcher 0.12.15 (0.12.16 available)
  material_color_utilities 0.2.0 (0.8.0 available)
  pub_semver 2.1.3 (2.1.4 available)
  pubspec_parse 1.1.0 (1.2.3 available)
  source_gen 1.0.3 (1.4.0 available)
  source_span 1.9.1 (1.10.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  test_api 0.5.1 (0.6.1 available)
  typed_data 1.3.1 (1.3.2 available)
  watcher 1.0.2 (1.1.0 available)
  yaml 3.1.1 (3.1.2 available)
Got dependencies in ..!
+ pod install
Analyzing dependencies
Downloading dependencies
Installing Flutter (1.0.0)
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
+ sh ../scripts/copy_framework.sh debug_sim FLUTTER_LOCAL_ENGINE
Coping Flutter.framework (debug-simulator)...
+ sed -i 's#FLUTTER_LOCAL_ENGINE[[:space:]]=[[:space:]].*;#FLUTTER_LOCAL_ENGINE = "/Volumes/NVME/Development/experiments/custom-flutter-engine/3.10.5";#g' Runner.xcodeproj/project.pbxproj
sed: 1: "Runner.xcodeproj/projec ...": invalid command code R
+ open Runner.xcworkspace
DenisovAV commented 1 year ago

Everything looks good. As a result of script execution, you should get opened XCode with a prepared project. You should choose Rosetta Simulator as a target and press the run button. If you don't see Rosetta simulators, take a look at the image, and choose "Show both"

Screenshot 2023-08-02 at 11 23 42
keanallen commented 1 year ago

what simulator should i use? apple tv simulator right?

keanallen commented 1 year ago

Hi @DenisovAV I got it working. I've successfully run your example app in my apple tv simulator. Thank you so much!


Now, we have an existing flutter tv app that is currently working in android tv and amazon firetv.

Question: