duplicate symbol error when add a 3rd library for arm6 - ios

I got the following error when add a 3rd party library:UMSNSLibrary.a
Please help, thanks!
" ld: duplicate symbol _OBJC_IVAR_$_UMSNSJsonParser.c in /Users/macbookpro/Downloads
/UMSNSLibrary.a(UMSNSJsonParser.o) and /Users/macbookpro/Downloads/HeXuanDemo EN/Build/Products/Debug-
iphoneosbThree20UI.a(UMSNSJsonParser.o) for architecture armv6 "

Simply try to delete file form one of the Location you don't need:
either from
/Users/macbookpro/Downloads /UMSNSLibrary.a(UMSNSJsonParser.o)
or /Users/macbookpro/Downloads/HeXuanDemo EN/Build/Products/Debug- iphoneosbThree20UI.a(UMSNSJsonParser.o)
Clean the build and reset simulator and launch again.
I think it will resolve this.

Target->Build Setting->Header Search Path / Library Search Path : Remove unwanted path from there.

Related

Why dulplicate symbol errors do not occur when linking both libsqlite3.dylib and libsqlcipher.a?

I'm integrating sqlcipher into an iOS project according to this tutorial: https://www.zetetic.net/sqlcipher/ios-tutorial/
There is a hot tip which says:If libsqlite3.dylib or another SQLite framework is listed in your Link Binary With Libraries list be sure to remove it, or you'll see duplicate symbol errors.
But I tried to add both libsqlite3.tbd(no dylib in xcode 7) and libsqlcipher.a to Link Binary With Libraries, the dulplicate symbol error do not occur! Why?
And I notice if I click the #import <sqlite3.h> line, xcode show the sqlite3.h file in xcode's lib folder, not the one in sqlcipher.
However, sqlcipher does work, the database is really encrypted.
libsqlite3.tbd is just a text file that defines platform architectures supported by the library, target platforms, dylib installation path and exported symbols. Using a .tbd file, you decrease the your bundled application size as the library binary is already included on the platform device so it does not need to be linked into your application image.
libsqlite3.tbd looks like this:
---
archs: [ armv7, armv7s, arm64 ]
platform: ios
install-name: /usr/lib/libsqlite3.dylib
current-version: 216.4
compatibility-version: 9.0
exports:
- archs: [ armv7, armv7s, arm64 ]
symbols: [ __sqlite3_lockstate, __sqlite3_purgeEligiblePagerCacheMemory,
__sqlite3_system_busy_handler, __sqlite_auto_profile,
__sqlite_auto_profile_syslog, __sqlite_auto_trace,
__sqlite_auto_trace_syslog, _sqlite3OsShmHasMultipleLinks,
_sqlite3OsShmRenamedWhileOpen, _sqlite3OsShmWasTruncated,
_sqlite3OsShmWasUnlinkedWhileOpen, _sqlite3VersionNumber,
_sqlite3VersionString, _sqlite3_aggregate_context,
_sqlite3_aggregate_count, _sqlite3_auto_extension,
_sqlite3_backup_finish, _sqlite3_backup_init, _sqlite3_backup_pagecount,
_sqlite3_backup_remaining, _sqlite3_backup_step,
_sqlite3_bind_blob, _sqlite3_bind_blob64, _sqlite3_bind_double,
_sqlite3_bind_int, _sqlite3_bind_int64, _sqlite3_bind_null,
_sqlite3_bind_parameter_count, _sqlite3_bind_parameter_index,
_sqlite3_bind_parameter_name, _sqlite3_bind_text,
_sqlite3_bind_text16, _sqlite3_bind_text64, _sqlite3_bind_value,
_sqlite3_bind_zeroblob, _sqlite3_blob_bytes, _sqlite3_blob_close,
_sqlite3_blob_open, _sqlite3_blob_read, _sqlite3_blob_reopen,
_sqlite3_blob_write, _sqlite3_busy_handler, _sqlite3_busy_timeout,
_sqlite3_cancel_auto_extension, _sqlite3_changes,
_sqlite3_clear_bindings, _sqlite3_close, _sqlite3_close_v2,
_sqlite3_collation_needed, _sqlite3_collation_needed16,
_sqlite3_column_blob, _sqlite3_column_bytes, _sqlite3_column_bytes16,
_sqlite3_column_count, _sqlite3_column_decltype,
_sqlite3_column_decltype16, _sqlite3_column_double,
_sqlite3_column_int, _sqlite3_column_int64, _sqlite3_column_name,
_sqlite3_column_name16, _sqlite3_column_text, _sqlite3_column_text16,
_sqlite3_column_type, _sqlite3_column_value, _sqlite3_commit_hook,
_sqlite3_compileoption_get, _sqlite3_compileoption_used,
_sqlite3_complete, _sqlite3_complete16, _sqlite3_config,
_sqlite3_context_db_handle, _sqlite3_create_collation,
_sqlite3_create_collation16, _sqlite3_create_collation_v2,
_sqlite3_create_function, _sqlite3_create_function16,
_sqlite3_create_function_v2, _sqlite3_create_module,
_sqlite3_create_module_v2, _sqlite3_data_count,
_sqlite3_data_directory, _sqlite3_db_config, _sqlite3_db_filename,
_sqlite3_db_handle, _sqlite3_db_mutex, _sqlite3_db_readonly,
_sqlite3_db_release_memory, _sqlite3_db_status,
_sqlite3_declare_vtab, _sqlite3_enable_shared_cache,
_sqlite3_errcode, _sqlite3_errmsg, _sqlite3_errmsg16,
_sqlite3_errstr, _sqlite3_exec, _sqlite3_expired,
_sqlite3_extended_errcode, _sqlite3_extended_result_codes,
_sqlite3_file_control, _sqlite3_finalize, _sqlite3_free,
_sqlite3_free_table, _sqlite3_get_autocommit, _sqlite3_get_auxdata,
_sqlite3_get_table, _sqlite3_global_recover, _sqlite3_initialize,
_sqlite3_intarray_bind, _sqlite3_intarray_create,
_sqlite3_interrupt, _sqlite3_last_insert_rowid,
_sqlite3_libversion, _sqlite3_libversion_number,
_sqlite3_limit, _sqlite3_log, _sqlite3_malloc, _sqlite3_malloc64,
_sqlite3_memory_alarm, _sqlite3_memory_highwater,
_sqlite3_memory_used, _sqlite3_mprintf, _sqlite3_msize,
_sqlite3_mutex_alloc, _sqlite3_mutex_enter, _sqlite3_mutex_free,
_sqlite3_mutex_leave, _sqlite3_mutex_try, _sqlite3_next_stmt,
_sqlite3_open, _sqlite3_open16, _sqlite3_open_v2,
_sqlite3_os_end, _sqlite3_os_init, _sqlite3_overload_function,
_sqlite3_prepare, _sqlite3_prepare16, _sqlite3_prepare16_v2,
_sqlite3_prepare_v2, _sqlite3_profile, _sqlite3_progress_handler,
_sqlite3_randomness, _sqlite3_realloc, _sqlite3_realloc64,
_sqlite3_release_memory, _sqlite3_reset, _sqlite3_reset_auto_extension,
_sqlite3_result_blob, _sqlite3_result_blob64, _sqlite3_result_double,
_sqlite3_result_error, _sqlite3_result_error16,
_sqlite3_result_error_code, _sqlite3_result_error_nomem,
_sqlite3_result_error_toobig, _sqlite3_result_int,
_sqlite3_result_int64, _sqlite3_result_null, _sqlite3_result_text,
_sqlite3_result_text16, _sqlite3_result_text16be,
_sqlite3_result_text16le, _sqlite3_result_text64,
_sqlite3_result_value, _sqlite3_result_zeroblob,
_sqlite3_rollback_hook, _sqlite3_rtree_geometry_callback,
_sqlite3_rtree_query_callback, _sqlite3_set_authorizer,
_sqlite3_set_auxdata, _sqlite3_shutdown, _sqlite3_sleep,
_sqlite3_snprintf, _sqlite3_soft_heap_limit, _sqlite3_soft_heap_limit64,
_sqlite3_sourceid, _sqlite3_sql, _sqlite3_status,
_sqlite3_status64, _sqlite3_step, _sqlite3_stmt_busy,
_sqlite3_stmt_readonly, _sqlite3_stmt_status, _sqlite3_strglob,
_sqlite3_stricmp, _sqlite3_strnicmp, _sqlite3_table_column_metadata,
_sqlite3_temp_directory, _sqlite3_test_control,
_sqlite3_thread_cleanup, _sqlite3_threadsafe, _sqlite3_total_changes,
_sqlite3_trace, _sqlite3_transfer_bindings, _sqlite3_update_hook,
_sqlite3_uri_boolean, _sqlite3_uri_int64, _sqlite3_uri_parameter,
_sqlite3_user_data, _sqlite3_value_blob, _sqlite3_value_bytes,
_sqlite3_value_bytes16, _sqlite3_value_double, _sqlite3_value_int,
_sqlite3_value_int64, _sqlite3_value_numeric_type,
_sqlite3_value_text, _sqlite3_value_text16, _sqlite3_value_text16be,
_sqlite3_value_text16le, _sqlite3_value_type, _sqlite3_version,
_sqlite3_vfs_find, _sqlite3_vfs_register, _sqlite3_vfs_unregister,
_sqlite3_vmprintf, _sqlite3_vsnprintf, _sqlite3_vtab_config,
_sqlite3_vtab_on_conflict, _sqlite3_wal_autocheckpoint,
_sqlite3_wal_checkpoint, _sqlite3_wal_checkpoint_v2,
_sqlite3_wal_hook ]
...
You do not receive a duplicate symbol linker error because you are only including a single binary library, libsqlcipher.a. You need to remove the libsqlite3.tbd reference and include libsqlcipher.a if you wish to use SQLCipher within your iOS application.
I encounted the same problem, if you do not remove the libsqlite3.0.tbd, the encryption will depend on the ios system, on iOS 13 and later, it will be encrypted using system algorithm, on iOS 12 and earier , the db wont be encrypted.
You did not receive duplicate symbols error, cause the system sqlite is a dynamic library.

Xcode "no such file or directory" if filename contains $$ sign?

Using xcode 6 and including files with names like Some$$Class.h and Some$$Class.m leads to problems. Xcode shows to error:
clang: error: no such file or directory: '/Users/test/Some$ClassX.m'
clang: error: no input files
How can I force Xcode to handle files with $$in its name correctly?
There is a very! dirty hack.
If you look to the error message, you can see that the build process of Xcode replaces the $$ of Some$$Class.m with a single $. (Obviously there is no problem with Some$$Class.h) It is an escape sequence.
Some$$Class.m -> Some$Class.m
Therefore you can use Some$$$$Class.m to get Some$$Class.m.
Simply add an (empty) File with the name Some$$$$Class.m to your project to show Xcode that it exists. You have to do this once.
Generate your Some$$Class.m as you did as many times as you want.
When building Xcode will believe that it compiles and links Some$$$$Class.m, but in fact compiles and builds Some$$Class.m.
But you should really, really avoid these names. If the files are generated automatically it should be possible to rename them automatically.

xcodeproj adds framework but linker can't find it

I'm adding a custom framework to my Xcode project using the xcodeproj Ruby Gem:
top_group = project.groups[0]
framework_ref = top_group.new_file(framework_path)
target = project.targets[0]
target.frameworks_build_phase.add_file_reference(framework_ref)
When I then open Xcode and look at the target, the framework is listed correctly under Linked Frameworks and Libraries, yet the linker complains that the framework cannot be found when building. Dragging the framework in the Linked Frameworks list in Xcode fixes it, and I can build successfully.
Why? Dragging seems to force Xcode to regenerate the project.pbxproj and add a missing reference. What would that be?
you need to set the path where your framework is!
append the path in build settings for "FRAMEWORK_SEARCH_PATHS"
settings = target.build_settings("Debug")
settings["FRAMEWORK_SEARCH_PATHS"] = [settings["FRAMEWORK_SEARCH_PATHS"], your_framework_directory ]
or
settings["FRAMEWORK_SEARCH_PATHS"] = settings["FRAMEWORK_SEARCH_PATHS"] + " " + your_framework_directory ]
Append the path in build setting as follows:
#Add framework search path
settings = target.build_settings("Release")
settings["FRAMEWORK_SEARCH_PATHS"] = Array(settings["FRAMEWORK_SEARCH_PATHS"])<< '$(PROJECT_DIR)/SDK'
settings["LIBRARY_SEARCH_PATHS"] = Array(settings["LIBRARY_SEARCH_PATHS"])<< '$(PROJECT_DIR)/SDK'

clang: error: no such file or directory: ASIAuthenticationDialog.m

I have this error:
clang: error: no such file or directory:
'/Users/usuario/Desktop/echonest-echoprint-ios-sample-b937c04/Classes/ASIHTTP/clang:
error: no such file or directory:'
I want to run the "echoprint-ios-sample" project and I import the ASIHTTP files
I donĀ“t know what is the problem :(
Someone can help me?
Thanks!
If you u've deleted any h or m files, go through the project navigation(command + 1) in your xcode, there may be some reference(will be in red color) in that project navigator. U can delete it. Then there'll not be such an error. Hope this would help you.
Else, have a look at this link

QuickDialog/QuickDialog.h file not found xcode 4.2

Hy, I want to use the QuickDialog library but gives me error.
The step that I made:
download it from github
copy the directory into my project's directory
add QuickDialog.xcodeproject
my project --> Build Phrases:
Target dipendencies: add QuickDialog
link Binary : add libQuickDialog.a
include in mi file Prefix.phc :#import
my project --> Build Settings:
Other linker flags: -ObjC
User header search paths : "${PROJECT_DIR}/QuickDialog" and check the box
always serach user path : YES
run
But give me the error:
QuickDialog/QuickDialog.h file not found
What is wrong???
Please help me!!
If you put this: "${PROJECT_DIR}/QuickDialog"
and you try to import "QuickDialog/QuickDialog.h"
that means that he goes in directory: "${PROJECT_DIR}/QuickDialog/QuickDialog/QuickDialog.h" ?
Did you try to put just: "QuickDialog.h" ?
EDIT: The solution is here: Including QuickDialog into Xcode 4.2 Project

Resources