Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'record_mp3/record_mp3-Swift.h' file not found #6

Open
X-Wei opened this issue Aug 29, 2020 · 6 comments
Open

'record_mp3/record_mp3-Swift.h' file not found #6

X-Wei opened this issue Aug 29, 2020 · 6 comments

Comments

@X-Wei
Copy link

X-Wei commented Aug 29, 2020

  • record_mp3 package version: 2.1.0
  • flutter channel: beta

Got this error while trying to build iOS app via codemagic:

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    2 warnings generated.
    1 warning generated.
    /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:101:9: warning: 'dispatch_queue_set_specific' is only available on iOS 5.0 or newer [-Wunguarded-availability]
            dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'Foundation' imported from /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Dispatch' imported from /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
    /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include/dispatch/queue.h:1498:1: note: 'dispatch_queue_set_specific' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 4.3.0
    dispatch_queue_set_specific(dispatch_queue_t queue, const void *key,
    ^
    /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:101:9: note: enclose 'dispatch_queue_set_specific' in an @available check to silence this warning
            dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:184:54: warning: 'dispatch_get_specific' is only available on iOS 5.0 or newer [-Wunguarded-availability]
        FMDatabaseQueue *currentSyncQueue = (__bridge id)dispatch_get_specific(kDispatchQueueSpecificKey);
                                                         ^~~~~~~~~~~~~~~~~~~~~
    In module 'Foundation' imported from /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Dispatch' imported from /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
    /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include/dispatch/queue.h:1554:1: note: 'dispatch_get_specific' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 4.3.0
    dispatch_get_specific(const void *key);
    ^
    /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:184:54: note: enclose 'dispatch_get_specific' in an @available check to silence this warning
        FMDatabaseQueue *currentSyncQueue = (__bridge id)dispatch_get_specific(kDispatchQueueSpecificKey);
                                                         ^~~~~~~~~~~~~~~~~~~~~
    2 warnings generated.
    /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabase.m:1486:15: warning: 'sqlite3_wal_checkpoint_v2' is only available on iOS 5.0 or newer [-Wunguarded-availability]
        int err = sqlite3_wal_checkpoint_v2(_db, dbName, checkpointMode, logFrameCount, checkpointCount);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'SQLite3' imported from /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabase.m:8:
    /Applications/Xcode-11.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include/sqlite3.h:8428:16: note: 'sqlite3_wal_checkpoint_v2' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 4.3.0
    SQLITE_API int sqlite3_wal_checkpoint_v2(
                   ^
    /Users/builder/clone/ios/Pods/FMDB/src/fmdb/FMDatabase.m:1486:15: note: enclose 'sqlite3_wal_checkpoint_v2' in an @available check to silence this warning
        int err = sqlite3_wal_checkpoint_v2(_db, dbName, checkpointMode, logFrameCount, checkpointCount);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/record_mp3-2.1.0/ios/Classes/SwiftRecordMp3Plugin.swift:22:9: warning: result of 'SwiftRecordMp3Plugin' initializer is unused
            SwiftRecordMp3Plugin(registrar: registrar)
            ^                   ~~~~~~~~~~~~~~~~~~~~~~
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/record_mp3-2.1.0/ios/Classes/SwiftRecordMp3Plugin.swift:22:9: warning: result of 'SwiftRecordMp3Plugin' initializer is unused
            SwiftRecordMp3Plugin(registrar: registrar)
            ^                   ~~~~~~~~~~~~~~~~~~~~~~
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/record_mp3-2.1.0/ios/Classes/RecordMp3Plugin.m:2:9: fatal error: 'record_mp3/record_mp3-Swift.h' file not found
    #import <record_mp3/record_mp3-Swift.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'FMDB' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'BoringSSL-GRPC' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'nanopb' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'GTMSessionFetcher' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'AppAuth' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/record_mp3-2.1.0/ios/Classes/Fat-Lame/lib/libmp3lame.a' of type 'archive.ar' for architecture 'armv7' (in target 'record_mp3' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/record_mp3-2.1.0/ios/Classes/Fat-Lame/lib/libmp3lame.a' of type 'archive.ar' for architecture 'arm64' (in target 'record_mp3' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 5.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'leveldb-library' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'abseil' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'GTMAppAuth' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'gRPC-Core' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.6.99. (in target 'gRPC-C++' from project 'Pods')

@Nader2004
Copy link

Nader2004 commented Nov 3, 2020

Any updates on this issue ?

@rainerlonau
Copy link

I´ve got the same error here. It seems the file is missing. Please have a look and include it or fix the issue. Thanks!

Xcode's output: ↳ /Users/USER/_dev/flutter/.pub-cache/hosted/pub.dartlang.org/record_mp3-2.1.0/ios/Classes/RecordMp3Plugin.m:2:9: fatal error: 'record_mp3/record_mp3-Swift.h' file not found #import <record_mp3/record_mp3-Swift.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.

@rainerlonau
Copy link

I just tried to use this plugin again. When cloning the whole repo and using the 'example' folder, I can build and run the project on the iPhone! After changing the three 'Expanded' errors and replacing the widgets with simple Container for example.

If I comment the lines
record_mp3: path: ../
and use
record_mp3: ^2.1.0
at dependencies instead, the projects builds, but stops running. This is the only output when the white screen is shown:
2020-12-14 15:41:00.310271+0100 Runner[29032:9587742] Metal API Validation Enabled warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. (lldb)

@zhetengxiang
Copy link

it worked for me.
add "use_frameworks!" in Podfile

target 'Runner' do
  use_frameworks! # add this
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

@rainerlonau
Copy link

Thanks for your reply @zhetengxiang, but I´m still unable to get it working.

What I did: Clone your repo. Open the ‚example‘ in Android Studio. Then:

  1. Change Expanded to Container three times in main.dart to fix the errors
  2. Open Xcode project and adjust team signing
  3. Clean build folder
  4. ‚Build and run‘
    -> App works

Then comment relative path to record_mp3 plugin and add ‚record_mp3: ^2.1.0‘ to dependencies like a normal plugin. App doesn’t work. The ‚use_frameworks!‘ Is already in your Podfile.

Error in Android Studio:

Xcode build done.                                           29,6s
Installing and launching...
(lldb) Process 32715 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x16f00bfe0)
    frame #0: 0x00000001a3c57d70 libobjc.A.dylib`objc_storeStrong
libobjc.A.dylib`objc_storeStrong:
->  0x1a3c57d70 <+0>:  stp    x22, x21, [sp, #-0x30]!
    0x1a3c57d74 <+4>:  stp    x20, x19, [sp, #0x10]
    0x1a3c57d78 <+8>:  stp    x29, x30, [sp, #0x20]
    0x1a3c57d7c <+12>: add    x29, sp, #0x20            ; =0x20 
Target 0: (Runner) stopped.

Error in Xcode:

2020-12-15 08:37:00.076274+0100 Runner[32723:9850143] Metal API Validation Enabled
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
(lldb) 

I´m working on a new M1 MacBook:
MacBook-Air-von-Rainer:flutter_demo_recordmp3-2 rainermacbook$ flutter doctor -v
[✓] Flutter (Channel unknown, 1.23.0-18.1.pre, on macOS 11.0.1 20B29 x86_64, locale de-DE)
• Flutter version 1.23.0-18.1.pre at /Users/rainermacbook/_dev/flutter
• Framework revision 198df796aa (9 weeks ago), 2020-10-15 12:04:33 -0700
• Engine revision 1d12d82d9c
• Dart version 2.11.0 (build 2.11.0-213.1.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/rainermacbook/_dev/Android/sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Users/rainermacbook/_dev/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.10.0

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin installed
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (1 available)
• iPhone X (NAME) (mobile) • 651NUMBERS56e • ios • iOS 14.2

• No issues found!

@Pavel-Gorokhov
Copy link

Try to create new Flutter project with Swift support for iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants