mikeperri / flutter_sequencer

A Flutter plugin for music sequencing.
Other
90 stars 39 forks source link

Could not build the application for the simulator. #18

Open k1005 opened 2 years ago

k1005 commented 2 years ago
The plugin `flutter_midi` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on iPhone 11 in debug mode...
Running Xcode build...
Xcode build done.                                            6.4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    In file included from /usr/local/Caskroom/flutter/2.5.0/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sequencer-0.4.1/ios/Classes/AudioUnit/Sfizz/SfizzDSPKernelAdapter.mm:11:
    In file included from /usr/local/Caskroom/flutter/2.5.0/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sequencer-0.4.1/ios/Classes/AudioUnit/Sfizz/SfizzDSPKernel.hpp:12:
    //usr/local/Caskroom/flutter/2.5.0/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sequencer-0.4.1/ios/Classes/IInstrument/SharedInstruments/SfizzSamplerInstrument.h:6:10: fatal error: 'sfizz.hpp' file not found
    #include "sfizz.hpp"
             ^~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete

Could not build the application for the simulator.
Error launching application on iPhone 11.

My environment is below

% ./build/sequencer_test 
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from BufferTest
[ RUN      ] BufferTest.AddOverBufferSize
[       OK ] BufferTest.AddOverBufferSize (1 ms)
[ RUN      ] BufferTest.RemoveAll
[       OK ] BufferTest.RemoveAll (0 ms)
[ RUN      ] BufferTest.AddAndRemoveAndAdd
[       OK ] BufferTest.AddAndRemoveAndAdd (0 ms)
[ RUN      ] BufferTest.Count
[       OK ] BufferTest.Count (0 ms)
[ RUN      ] BufferTest.ClearAfter
[       OK ] BufferTest.ClearAfter (0 ms)
[----------] 5 tests from BufferTest (1 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (1 ms total)
[  PASSED  ] 5 tests.

% flutter --version
Flutter 2.5.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4cc385b4b8 (24 hours ago) • 2021-09-07 23:01:49 -0700
Engine • revision f0826da7ef
Tools • Dart 2.14.0

I want to fix this problem. Plz Tell me how can I fix my application. HELP ME PLZ.

mikeperri commented 2 years ago

Hey, thanks for opening an issue! I tried to reproduce this by cloning a new copy of the library and running flutter build ios in the example directory, but I didn't have any issues. I'll try to help you debug.

It sounds like the Xcode build can't find the sfizz headers. Sfizz is a SFZ player library. It should get downloaded by git in the prepare.sh script. Then, the flutter_sequencer.podspec should add the ios/third_party/sfizz/src directory to the pod target's HEADER_SEARCH_PATHS. Some part of that must not be working if it can't find sfizz.hpp.

First off, can you build the example? If you're trying to build your own app, make sure your Podfile matches the example's Podfile.

Then, either way, can you check if there's an sfizz directory under ios/third_party?

Can you also add some echo test... statements to the prepare.sh script to make sure it's getting to the end? Then run sudo gem install cocoapods-clean, and in your project's ios directory, run pod clean and pod install --verbose.

k1005 commented 2 years ago

Thanks for your answer. But I can't try right now. Cause this is my home project and I'am at working in company office.

I will try as your recommended when I am home. And then I will write comment on this page.

k1005 commented 2 years ago

I have checked. But I cannot found ios/third_party directory. Do I have to something?

k1005 commented 2 years ago

I found something.

I changed pod target's HEADER_SEARCH_PATHS on flutter_sequencer.podspec Then build is working.

as-is: "${PROJECT_DIR}/../../.."/ios/third_party/sfizz/src to-be: /usr/local/Caskroom/flutter/2.5.0/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sequencer-0.4.2/ios/third_party/sfizz/src