I am trying to play a sound when a uibutton is pressed..
this is my code
-(IBAction) playSound:(id)sender{
NSString *path = [[NSBundle mainBundle] pathForResource:#"SQUEEK" ofType:#"wav"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate=self;
[theAudio play];
}
this is the output when the button is pressed
2012-07-13 16:41:02.803 squeek[1475:12103] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:02.811 squeek[1475:12103] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:03.389 squeek[1475:12103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:03.396 squeek[1475:12103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:03.409 squeek[1475:12103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:03.417 squeek[1475:12103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:03.431 squeek[1475:12103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-07-13 16:41:03.440 squeek[1475:12103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
the IBAction is hooked up to the UIButton with the touch up inside feature, also I have added the avfoundation framework.
any help would be greatly appreciated.
#HurkNburkS
You just need a little more search in Stack Overflow before asking the same question. Whatever check the below question and try the solutions given in that.
Sound not playing with AVAudioPlayer
Supported Audio file formats in iPhone
Check out your audio format could be a problem or your "theAudio" instance should be deallocated.
Try like this and print your error...
NSError *error;
audioPlayer = [[AVAudioPlayer alloc]
initWithContentsOfURL:url
error:&error];
if (error)
{
NSLog(#"Error in audioPlayer: %#",
[error localizedDescription]);
} else {
audioPlayer.delegate = self;
[audioPlayer prepareToPlay];
}
Related
I'm linking a CMake generated framework to an iOS test Bundle application, in order to execute the tests contained in the framework over an iOS platform.
When building, I have an very strange errors in the link stage:
ld: warning: directory not found for option '-L/Users/fporcarelli/GIT/iOSApp/iGeoMobile/smartsdk-middleware/smartsdk-core/Unit-Tests/iOS/SmartSDK-core-tester/../../build/NavNetwork/smartsdk-core/External/lib'
Undefined symbols for architecture x86_64:
"_strchr", referenced from:
_lprofFindFirstDirSeparator in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_open", referenced from:
_lprofOpenFileEx in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_uname", referenced from:
_lprofGetHostName in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_ftell", referenced from:
_getProfileFileSizeForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_strncpy", referenced from:
_createProfileDir in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofGetHostName in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_setenv", referenced from:
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_fwrite", referenced from:
_fileWriter in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_atexit", referenced from:
___llvm_profile_register_write_file_atexit in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
(maybe you meant: ___llvm_profile_register_write_file_atexit)
"_fopen", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_mmap", referenced from:
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_munmap", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_ftruncate", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_fseek", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_fileWriter in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_getProfileFileSizeForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_fprintf", referenced from:
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_getProfileFileSizeForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofOpenFileEx in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
...
"_strerror", referenced from:
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_getProfileFileSizeForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_fclose", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_free", referenced from:
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_instrument_target_value in libclang_rt.profile_iossim.a(InstrProfilingValue.c.o)
"_strcmp", referenced from:
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_fileno", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofLockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
_lprofUnlockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_fflush", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_exit", referenced from:
_exitSignalHandler in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_getenv", referenced from:
___llvm_profile_initialize_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofSetupValueProfiler in libclang_rt.profile_iossim.a(InstrProfilingValue.c.o)
"_calloc", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_instrument_target_value in libclang_rt.profile_iossim.a(InstrProfilingValue.c.o)
"_sigaction", referenced from:
_lprofInstallSignalHandler in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_strdup", referenced from:
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_memset", referenced from:
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeOneValueProfData in libclang_rt.profile_iossim.a(InstrProfilingWriter.c.o)
"_fdopen", referenced from:
_lprofOpenFileEx in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_atoi", referenced from:
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofSetupValueProfiler in libclang_rt.profile_iossim.a(InstrProfilingValue.c.o)
"___stderrp", referenced from:
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_getProfileFileSizeForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofOpenFileEx in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
...
"_snprintf", referenced from:
_getCurFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_strlen", referenced from:
_getCurFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_createProfileDir in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"_fcntl", referenced from:
_lprofLockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
_lprofUnlockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
_lprofOpenFileEx in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_mkdir", referenced from:
___llvm_profile_recursive_mkdir in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
(maybe you meant: ___llvm_profile_recursive_mkdir)
"___error", referenced from:
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_writeFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_getProfileFileSizeForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_mmapProfileForMerging in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofLockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
_lprofUnlockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
...
"_getpid", referenced from:
_getCurFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_parseAndSetFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofLockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
_lprofUnlockFileHandle in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
_lprofOpenFileEx in libclang_rt.profile_iossim.a(InstrProfilingUtil.c.o)
"_ftello", referenced from:
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
"__Unwind_Resume", referenced from:
-[SmartSDK_core_tests testALL] in SmartSDK_core_tests.o
"___stack_chk_guard", referenced from:
-[SmartSDK_core_tests testALL] in SmartSDK_core_tests.o
_getCurFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_createProfileDir in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofBufferIOWrite in libclang_rt.profile_iossim.a(InstrProfilingWriter.c.o)
...
"_memcpy", referenced from:
_getCurFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofBufferWriter in libclang_rt.profile_iossim.a(InstrProfilingWriter.c.o)
_lprofBufferIOWrite in libclang_rt.profile_iossim.a(InstrProfilingWriter.c.o)
"___stack_chk_fail", referenced from:
-[SmartSDK_core_tests testALL] in SmartSDK_core_tests.o
_getCurFilename in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
___llvm_profile_write_file in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_truncateCurrentFile in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_initializeProfileForContinuousMode in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_createProfileDir in libclang_rt.profile_iossim.a(InstrProfilingFile.c.o)
_lprofBufferIOWrite in libclang_rt.profile_iossim.a(InstrProfilingWriter.c.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error is very strange, since the unresolved symbols do not belong to my code, but to clang-related static libraries...
Thanks in advance for any help
I found the issue. One of the CMake targets in my framework was named "System". So, the correspondent output file was a "libSystem.a" static library. Swift framework must link to every target an homonym library which contains all standard libraries. For some reasons, the linker found my library in place of the correct one, and so every framework was not able to find the symbols defined in standard libraries (since they are not defined in my System lib).
I wanna build React Native iOS PhotoEditor module in Swift.
I simply created a new library using react-native-create-library and modified the iOS module like this.
For now, I just wanna push a simple UIViewController.
I followed Native Modules Guideline of React Native but I am getting error while launching the app.
I attached the screenshot of the structure, full codes and error logs.
// RNPhotoEditor.swift
// RNPhotoEditor
//
// Created by Gang on 2/13/19.
// Copyright © 2019 Facebook. All rights reserved.
//
import Foundation
import UIKit
#objc(RNPhotoEditor)
class RNPhotoEditor: NSObject {
#objc func Edit(props: NSDictionary, onDone: RCTResponseSenderBlock, onCancel: RCTResponseSenderBlock) -> Void {
let editorVC = PhotoEditorViewController()
getRootVC().present(editorVC, animated: true, completion: nil)
}
func getRootVC() -> UIViewController {
var root = UIApplication.shared.keyWindow?.rootViewController
while root?.presentedViewController != nil {
root = root?.presentedViewController
}
return root!
}
}
//
// RNPhotoEditorBridge.m
// RNPhotoEditor
//
// Created by Gang on 2/13/19.
// Copyright © 2019 Facebook. All rights reserved.
//
#import <React/RCTBridgeModule.h>
#interface RCT_EXTERN_MODULE(RNPhotoEditor, NSObject)
RCT_EXTERN_METHOD(Edit:(nonnull NSDictionary *)props onDone:(RCTResponseSenderBlock)onDone onCancel:(RCTResponseSenderBlock)onCancel)
#end
//
// RNPhotoEditor-Bridging-Header.h
// RNPhotoEditor-Bridging-Header
//
// Created by Gang on 2/13/19.
// Copyright © 2019 Facebook. All rights reserved.
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <React/RCTBridgeModule.h>
Here is the error log.
ld: warning: directory not found for option '-L/Users/gang/Library/Developer/Xcode/DerivedData/app-ezczldbbkpyqcxaeyxheyjdtqbth/Build/Products/Debug-iphoneos/React'
ld: warning: object file (/Users/gang/Library/Developer/Xcode/DerivedData/app-ezczldbbkpyqcxaeyxheyjdtqbth/Build/Products/Debug-iphoneos/libLRDRCTSimpleToast.a(UIView+Toast.o)) was built for newer iOS version (9.3) than being linked (9.0)
ld: warning: object file (/Users/gang/Library/Developer/Xcode/DerivedData/app-ezczldbbkpyqcxaeyxheyjdtqbth/Build/Products/Debug-iphoneos/libLRDRCTSimpleToast.a(LRDRCTSimpleToast.o)) was built for newer iOS version (9.3) than being linked (9.0)
ld: warning: Could not find auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find auto-linked library 'swiftFoundation'
ld: warning: Could not find auto-linked library 'swiftMetal'
ld: warning: Could not find auto-linked library 'swiftDarwin'
ld: warning: Could not find auto-linked library 'swiftUIKit'
ld: warning: Could not find auto-linked library 'swiftObjectiveC'
ld: warning: Could not find auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find auto-linked library 'swiftDispatch'
ld: warning: Could not find auto-linked library 'swiftCoreImage'
ld: warning: Could not find auto-linked library 'swiftQuartzCore'
ld: warning: Could not find auto-linked library 'swiftCore'
ld: warning: Could not find auto-linked library 'swiftSwiftOnoneSupport'
Undefined symbols for architecture arm64:
"value witness table for Builtin.UnknownObject", referenced from:
full type metadata for RNPhotoEditor.PhotoEditorViewController in libRNPhotoEditor.a(PhotoEditorViewController.o)
full type metadata for RNPhotoEditor.RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
"(extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString", referenced from:
RNPhotoEditor.PhotoEditorViewController.init(nibName: Swift.String?, bundle: __C.NSBundle?) -> RNPhotoEditor.PhotoEditorViewController in libRNPhotoEditor.a(PhotoEditorViewController.o)
"static (extension in Foundation):Swift.String._unconditionallyBridgeFromObjectiveC(__C.NSString?) -> Swift.String", referenced from:
#objc RNPhotoEditor.PhotoEditorViewController.init(nibName: Swift.String?, bundle: __C.NSBundle?) -> RNPhotoEditor.PhotoEditorViewController in libRNPhotoEditor.a(PhotoEditorViewController.o)
"(extension in Foundation):Swift.Array._bridgeToObjectiveC() -> __C.NSArray", referenced from:
reabstraction thunk helper from #callee_unowned #convention(block) (#unowned __C.NSArray?) -> () to #escaping #callee_guaranteed (#guaranteed [Any]?) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"Swift._fatalErrorMessage(_: Swift.StaticString, _: Swift.StaticString, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never", referenced from:
RNPhotoEditor.RNPhotoEditor.getRootVC() -> __C.UIViewController in libRNPhotoEditor.a(RNPhotoEditor.o)
"type metadata for Any", referenced from:
reabstraction thunk helper from #callee_unowned #convention(block) (#unowned __C.NSArray?) -> () to #escaping #callee_guaranteed (#guaranteed [Any]?) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"__swift_FORCE_LOAD_$_swiftCoreFoundation", referenced from:
__swift_FORCE_LOAD_$_swiftCoreFoundation_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftCoreFoundation_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftCoreFoundation_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftCoreGraphics", referenced from:
__swift_FORCE_LOAD_$_swiftCoreGraphics_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftCoreGraphics_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftCoreGraphics_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftCoreImage", referenced from:
__swift_FORCE_LOAD_$_swiftCoreImage_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftCoreImage_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftCoreImage_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftDarwin", referenced from:
__swift_FORCE_LOAD_$_swiftDarwin_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftDarwin_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftDarwin_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftDispatch", referenced from:
__swift_FORCE_LOAD_$_swiftDispatch_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftDispatch_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftDispatch_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftFoundation", referenced from:
__swift_FORCE_LOAD_$_swiftFoundation_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftFoundation_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftFoundation_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftMetal", referenced from:
__swift_FORCE_LOAD_$_swiftMetal_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftMetal_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftMetal_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftObjectiveC", referenced from:
__swift_FORCE_LOAD_$_swiftObjectiveC_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftObjectiveC_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftObjectiveC_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftQuartzCore", referenced from:
__swift_FORCE_LOAD_$_swiftQuartzCore_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftQuartzCore_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftQuartzCore_$_RNPhotoEditor)
"__swift_FORCE_LOAD_$_swiftUIKit", referenced from:
__swift_FORCE_LOAD_$_swiftUIKit_$_RNPhotoEditor in libRNPhotoEditor.a(PhotoEditorViewController.o)
__swift_FORCE_LOAD_$_swiftUIKit_$_RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftUIKit_$_RNPhotoEditor)
"_swift_allocObject", referenced from:
#objc RNPhotoEditor.RNPhotoEditor.Edit(props: __C.NSDictionary, onDone: ([Any]?) -> (), onCancel: ([Any]?) -> ()) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_bridgeObjectRelease", referenced from:
RNPhotoEditor.PhotoEditorViewController.init(nibName: Swift.String?, bundle: __C.NSBundle?) -> RNPhotoEditor.PhotoEditorViewController in libRNPhotoEditor.a(PhotoEditorViewController.o)
outlined consume of Swift.String? in libRNPhotoEditor.a(PhotoEditorViewController.o)
reabstraction thunk helper from #callee_unowned #convention(block) (#unowned __C.NSArray?) -> () to #escaping #callee_guaranteed (#guaranteed [Any]?) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_bridgeObjectRetain", referenced from:
outlined copy of Swift.String? in libRNPhotoEditor.a(PhotoEditorViewController.o)
reabstraction thunk helper from #callee_unowned #convention(block) (#unowned __C.NSArray?) -> () to #escaping #callee_guaranteed (#guaranteed [Any]?) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_deallocObject", referenced from:
l_objectdestroy in libRNPhotoEditor.a(RNPhotoEditor.o)
l_objectdestroy.2 in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_getInitializedObjCClass", referenced from:
type metadata accessor for RNPhotoEditor.PhotoEditorViewController in libRNPhotoEditor.a(PhotoEditorViewController.o)
RNPhotoEditor.RNPhotoEditor.getRootVC() -> __C.UIViewController in libRNPhotoEditor.a(RNPhotoEditor.o)
type metadata accessor for RNPhotoEditor.RNPhotoEditor in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_getObjCClassFromMetadata", referenced from:
__C.UIViewController.__allocating_init() -> __C.UIViewController in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_isaMask", referenced from:
RNPhotoEditor.RNPhotoEditor.Edit(props: __C.NSDictionary, onDone: ([Any]?) -> (), onCancel: ([Any]?) -> ()) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_release", referenced from:
#objc RNPhotoEditor.RNPhotoEditor.Edit(props: __C.NSDictionary, onDone: ([Any]?) -> (), onCancel: ([Any]?) -> ()) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
"_swift_retain", referenced from:
#objc RNPhotoEditor.RNPhotoEditor.Edit(props: __C.NSDictionary, onDone: ([Any]?) -> (), onCancel: ([Any]?) -> ()) -> () in libRNPhotoEditor.a(RNPhotoEditor.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am really not sure what the following error means.
ld: symbol(s) not found for architecture arm64
Also, how can I clear this kind of warnings?
ld: warning: Could not find auto-linked library 'swiftUIKit'
Can someone please tell me how to write Swift iOS library for React Native? I am struggling for a couple of days but no luck.
I'd appreciate any help! Thanks.
I am trying to run the following test from Chapter 16: Testing with RxTest of Raywenderlich RxSwift book:
import XCTest
import RxSwift
import RxTest
#testable import Testing
class TestingViewModel : XCTestCase {
var viewModel: ViewModel!
var scheduler: ConcurrentDispatchQueueScheduler!
override func setUp() {
super.setUp()
viewModel = ViewModel()
scheduler = ConcurrentDispatchQueueScheduler(qos: .default)
}
func testColorNameIsRayWenderlichGreenWhenHexStringIs006636() {
// 1
let colorNameObservable = viewModel.colorName.asObservable().subscribeOn(scheduler)
// 2
viewModel.hexString.value = "#006636"
// 3
XCTAssertEqual("rayWenderlichGreen", try! colorNameObservable.toBlocking().first()!)
}
}
But I get this error on the simulator:
Undefined symbols for architecture x86_64:
"type metadata for RxCocoa.DriverSharingStrategy", referenced from:
TestingTests.TestingViewModel.testColorNameIsRayWenderlichGreenWhenHexStringIs006636() -> () in TestingViewModel.o
"protocol witness table for RxCocoa.DriverSharingStrategy : RxCocoa.SharingStrategyProtocol in RxCocoa", referenced from:
TestingTests.TestingViewModel.testColorNameIsRayWenderlichGreenWhenHexStringIs006636() -> () in TestingViewModel.o
"RxCocoa.SharedSequence.asObservable() -> RxSwift.Observable", referenced from:
TestingTests.TestingViewModel.testColorNameIsRayWenderlichGreenWhenHexStringIs006636() -> () in TestingViewModel.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And This one on iPhone 6s:
Undefined symbols for architecture arm64:
"type metadata for RxCocoa.DriverSharingStrategy", referenced from:
TestingTests.TestingViewModel.testColorNameIsRayWenderlichGreenWhenHexStringIs006636() -> () in TestingViewModel.o
"protocol witness table for RxCocoa.DriverSharingStrategy : RxCocoa.SharingStrategyProtocol in RxCocoa", referenced from:
TestingTests.TestingViewModel.testColorNameIsRayWenderlichGreenWhenHexStringIs006636() -> () in TestingViewModel.o
"RxCocoa.SharedSequence.asObservable() -> RxSwift.Observable", referenced from:
TestingTests.TestingViewModel.testColorNameIsRayWenderlichGreenWhenHexStringIs006636() -> () in TestingViewModel.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Unfortunately, there is no support for this issue in Raywenderlich's forums.
After a lot of searches, As somebody suggests here for another similar issue I found that this error will be solved by importing RxCocoa.
I have following code in Swift in A.swift file:
/// **A.swift**
protocol Johnkui: class {
var name: TruncatedView? { get set }
}
/// typealias TruncatedView = String
class TruncatedView: UIView {
}
extension UIView {
private struct TruncatedViewKey {
static var navigationViewKey = "navigationViewKey"
}
var name: TruncatedView? {
set {
objc_setAssociatedObject(self, &TruncatedViewKey.navigationViewKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_ASSIGN)
}
get {
return objc_getAssociatedObject(self, &TruncatedViewKey.navigationViewKey) as? TruncatedView
}
}
}
and B.swift file has following code:
/// B.swift
class JJ: UIView, Johnkui {
}
When compiling these two files, a linking error was reported:
Undefined symbols for architecture x86_64:
"__TFE9SwiftTestCSo6UIViewm4nameGSqCS_13TruncatedView_", referenced from:
__TTWC9SwiftTest2JJS_7JohnkuiS_FS1_m4nameGSqCS_13TruncatedView_ in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
However, when combining these two files into one, the error is gone, and I cannot find out the reason for this result, what's your explanation?
I'm trying to integrate Parse framework in my project built in iOS 7. I done in another project with iOS 6 and there wasn't any problem. With the new iOS, the project doesn't compile. It seems that the problem is Parsse framework isn't built for armv7s architecture. I don't know how to solve this problem.
I attach the problems that xcode 5 shows:
Undefined symbols for architecture armv7s: "_sqlite3_reset", referenced from:
_initializeStatement in Parse(PF_FBCacheIndex.o)
"_sqlite3_column_int", referenced from:
-[PF_FBCacheIndex _createCacheEntityInfo:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _fetchCurrentDiskUsage] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _trimDatabase] in Parse(PF_FBCacheIndex.o)
"_sqlite3_bind_int", referenced from:
-[PF_FBCacheIndex _updateEntryInDatabaseForKey:entry:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _writeEntryInDatabase:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _trimDatabase] in Parse(PF_FBCacheIndex.o)
"_sqlite3_column_text", referenced from:
-[PF_FBCacheIndex _createCacheEntityInfo:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _trimDatabase] in Parse(PF_FBCacheIndex.o)
"_sqlite3_bind_text", referenced from:
-[PF_FBCacheIndex _updateEntryInDatabaseForKey:entry:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _writeEntryInDatabase:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _readEntryFromDatabase:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _readEntriesFromDatabase:excludingFragment:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _removeEntryFromDatabaseForKey:] in Parse(PF_FBCacheIndex.o)
"_sqlite3_column_double", referenced from:
-[PF_FBCacheIndex _createCacheEntityInfo:] in Parse(PF_FBCacheIndex.o)
"_sqlite3_bind_double", referenced from:
-[PF_FBCacheIndex _updateEntryInDatabaseForKey:entry:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _writeEntryInDatabase:] in Parse(PF_FBCacheIndex.o)
"_sqlite3_step", referenced from:
-[PF_FBCacheIndex _updateEntryInDatabaseForKey:entry:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _writeEntryInDatabase:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _createCacheEntityInfo:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _fetchCurrentDiskUsage] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _removeEntryFromDatabaseForKey:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _dropTrimmingTable] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _trimDatabase] in Parse(PF_FBCacheIndex.o)
...
"_sqlite3_prepare_v2", referenced from:
_initializeStatement in Parse(PF_FBCacheIndex.o)
"_sqlite3_open_v2", referenced from:
___39-[PF_FBCacheIndex initWithCacheFolder:]_block_invoke in Parse(PF_FBCacheIndex.o)
"_sqlite3_errmsg", referenced from:
_releaseStatement in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _updateEntryInDatabaseForKey:entry:] in Parse(PF_FBCacheIndex.o)
_initializeStatement in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _writeEntryInDatabase:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _readEntryFromDatabase:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _readEntriesFromDatabase:excludingFragment:] in Parse(PF_FBCacheIndex.o)
-[PF_FBCacheIndex _fetchCurrentDiskUsage] in Parse(PF_FBCacheIndex.o)
...
"_sqlite3_finalize", referenced from:
_releaseStatement in Parse(PF_FBCacheIndex.o)
"_sqlite3_close", referenced from:
___26-[PF_FBCacheIndex dealloc]_block_invoke in Parse(PF_FBCacheIndex.o)
"_sqlite3_exec", referenced from:
___39-[PF_FBCacheIndex initWithCacheFolder:]_block_invoke in Parse(PF_FBCacheIndex.o)
ld: symbol(s) not found for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've solved the problem: what worked for me was to include the libraries:
libsqlite.3dylib
libz.dylib
They can be found in the Parse PushNotificationTutorial project. You can download it from the web of Parse.