iOSプロジェクトに仕込んだFMDB+SQLCipherでエラーがドーンで頭ががバーンで疲れたメモ


## はじまり
Jenkinsでビルド回してたらエラーがドーン!
GUIのXcodeなら大丈夫だったのになんだこれは!

```
ld: warning: ignoring file /Users/192agur2/.jenkins/jobs/test/workspace/src/build/libsqlcipher.a, file was built for archive which is not the architecture being linked (armv7): /Users/192agur2/.jenkins/jobs/test/workspace/src/build/libsqlcipher.a
Undefined symbols for architecture armv7:
  "_sqlite3_user_data", referenced from:
      _FMDBBlockSQLiteCallBackFunction in FMDatabase.o
  "_sqlite3_exec", referenced from:
      -[FMDatabase executeStatements:withResultBlock:] in FMDatabase.o
  "_sqlite3_bind_blob", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_free", referenced from:
      -[FMDatabase executeStatements:withResultBlock:] in FMDatabase.o
  "_sqlite3_bind_int64", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_double", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_text", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_reset", referenced from:
      -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
      -[FMStatement reset] in FMDatabase.o
  "_sqlite3_changes", referenced from:
      -[FMDatabase changes] in FMDatabase.o
  "_sqlite3_create_function", referenced from:
      -[FMDatabase makeFunctionNamed:maximumArguments:withBlock:] in FMDatabase.o
  "_sqlite3_key", referenced from:
      -[FMDatabase setKeyWithData:] in FMDatabase.o
  "_sqlite3_rekey", referenced from:
      -[FMDatabase rekeyWithData:] in FMDatabase.o
  "_sqlite3_busy_handler", referenced from:
      -[FMDatabase setMaxBusyRetryTimeInterval:] in FMDatabase.o
  "_sqlite3_column_int64", referenced from:
      -[FMResultSet longForColumnIndex:] in FMResultSet.o
      -[FMResultSet longLongIntForColumnIndex:] in FMResultSet.o
  "_sqlite3_next_stmt", referenced from:
      -[FMDatabase close] in FMDatabase.o
  "_sqlite3_open_v2", referenced from:
      -[FMDatabase openWithFlags:vfs:] in FMDatabase.o
  "_sqlite3_last_insert_rowid", referenced from:
      -[FMDatabase lastInsertRowId] in FMDatabase.o
  "_sqlite3_open", referenced from:
      -[FMDatabase open] in FMDatabase.o
  "_sqlite3_bind_null", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_threadsafe", referenced from:
      -[FMDatabase initWithPath:] in FMDatabase.o
      +[FMDatabase isSQLiteThreadSafe] in FMDatabase.o
  "_sqlite3_bind_parameter_index", referenced from:
      -[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
      -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
  "_sqlite3_column_bytes", referenced from:
      -[FMResultSet dataForColumnIndex:] in FMResultSet.o
      -[FMResultSet dataNoCopyForColumnIndex:] in FMResultSet.o
  "_sqlite3_sleep", referenced from:
      _FMDBDatabaseBusyHandler in FMDatabase.o
  "_sqlite3_column_double", referenced from:
      -[FMResultSet doubleForColumnIndex:] in FMResultSet.o
  "_sqlite3_data_count", referenced from:
      -[FMResultSet resultDict] in FMResultSet.o
      -[FMResultSet resultDictionary] in FMResultSet.o
  "_sqlite3_column_blob", referenced from:
      -[FMResultSet dataForColumnIndex:] in FMResultSet.o
      -[FMResultSet dataNoCopyForColumnIndex:] in FMResultSet.o
  "_sqlite3_bind_int", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_column_name", referenced from:
      -[FMResultSet columnNameToIndexMap] in FMResultSet.o
      -[FMResultSet kvcMagic:] in FMResultSet.o
      -[FMResultSet resultDictionary] in FMResultSet.o
      -[FMResultSet columnNameForIndex:] in FMResultSet.o
```

armv7以外にもarm7とかarm64の同様エラーが出てるし頭がバーン。
Framework足したり引いたりしたけど効果がないようだ……。
そしてググり尽くす、解決手法は出てくるも一向に効果がないようだ……。

## おわり
プロジェクトに入れたSQLCipherの [TARGETS] > [sqlcipher] > [Build Settings] > [Architectures] > [Supported Platforms] の指定を [iOS] に変えたら解決した。あと [PROJECT] も同様に設定した。

![](http://p.twpl.jp/show/orig/FFOFZ)


## 感想
- 最初 [Supported Platforms] の指定は [iphoneos macos iphonesimurator]みたいになってた。
 - 何が違うんじゃ
- Xcodebuildは細かい。厳しい。
- FMDBは悪い子じゃなかった。
- iOSにやられすぎなワイ