橋田レポート

Unity Xcode Android 関連のEtc...

"_OBJC_CLASS_$_FIROptions" Error 解決策 ( Unity Build -> Xcode )

Error内容

ld: warning: arm64 function not 4-byte aligned: ltmp0 from /Users/tai/unityProjects/Application-iOS/Escapeman/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/tai/unityProjects/Application-iOS/Escapeman/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FIROptions", referenced from:
      objc-class-ref in libApp.a(app_ios_c76c7d869e568a9b561ea55e25a7dcc0.o)
  "_OBJC_CLASS_$_FIRInstanceID", referenced from:
      objc-class-ref in libMessaging.a(messaging_0d72481c6b9f9d4c5456dcb81aa103f1.o)
  "_OBJC_CLASS_$_FIRApp", referenced from:
      objc-class-ref in libApp.a(app_ios_c76c7d869e568a9b561ea55e25a7dcc0.o)
  "_OBJC_CLASS_$_FIRMessaging", referenced from:
      objc-class-ref in libMessaging.a(messaging_0d72481c6b9f9d4c5456dcb81aa103f1.o)
  "_kFIRInstanceIDTokenRefreshNotification", referenced from:
      ____ZN8firebase9messaging17NotifyListenerSetEPNS0_8ListenerE_block_invoke in libMessaging.a(messaging_0d72481c6b9f9d4c5456dcb81aa103f1.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

解決方法

CocoaPodsを実行する

原因

framework不足

解説

「symbol(s) not found」 ← この原因はだいたい framework や source 不足。

上記のErrorはFirebase関連のFramework不足です。
XcodeのRootに Podfile を設置して pod install コマンドを実行してください。

 
以上。




※以下 今回(タイトルのError)限定の具体的な解決方法

Podfile内容

pods.command

配置

f:id:KojiroHashida:20170118123728p:plain

上記の様にPodfileとpods.commandを設置して、pods.commandをダブルクリックしてください。
pods.commandを実行すると同ディレクトリに 「Pods」 フォルダができます。

Xcode上でPodsフォルダの追加

f:id:KojiroHashida:20170118124452p:plain

PodsフォルダをXcode上に ドラッグ&ドロップ する
ドラッグ&ドロップXcodeのプロジェクトをクリーンすると確実に反映される。

以上。

補足

タイトルのErrorは消えるが、他のエラーが発生します!

その他のErrorを消すには

Compile Sources の GTMLogger.m に 「-fno-objc-arc」 を付加
Build Setting の Enable Objective-C Exceptions を Yes にする
GoogleService-Info.plistを設置する

keystoreの作成方法

keystore 生成コマンド

keytool -genkey -v -keystore kojiro_hashida.keystore -alias kojiro_hashida -keyalg RSA -validity 10000
  • 有効期限:10000日
  • keystore名:kojiro_hashida.keystore
  • エイリアス:kojiro_hashida
  • 暗号方式:RSA

 コピー用

keytool -genkey -v -keystore ***.keystore -alias *** -keyalg RSA -validity 10000

keystore 情報入力( コマンドライン )

[Kojiro-MacBook-Pro:~kojiro$ keytool -genkey -v -keystore kojiro_hashida.keystore -alias kojiro_hashida -keyalg RSA -validity 10000

キーストアのパスワードを入力してください:
新規パスワードを再入力してください:
[Unknown]:Kojiro Hashida
組織単位名は何ですか。
[Unknown]:Personal
組織名は何ですか。
[Unknown]:Personal
都市名または地域名は何ですか。
[Unknown]:Nakano-ku
都道府県名または州名は何ですか。
[Unknown]:Tokyo
この単位に該当する2文字の国コードは何ですか。
[Unknown]:jp
CN=Kojiro Hashida, OU=Personal, O=Personal,L=Nakano-ku,ST=Tokyo,C=jpでよろしいですか。
[いいえ]:y
10,000日間有効な2,048ビットのRSAの鍵ペアと自己署名型証明書(SHA256withRSA)を生成しています ディレクトリ名: CN=Kojiro Hashida, OU=Personal, O=Personal, L=Nakano-ku, ST=Tokyo, C=jp kojiro_hashidaの鍵パスワードを入力してください (キーストアのパスワードと同じ場合はRETURNを押してください):※1 [godofsleep.keystoreを格納中]

 ※1 : Enterを押して下さい。

proxychains4 導入・設定・使用 [Linux(Ubuntu)]

導入

1: sudo git clone https://github.om/rofl0r/proxychains-ng
2: ./configure --prefix=/usr --sysconfdir=/etc
3: make
4: sudo make install
5: sudo make install-config

設定

1:sudo vim /usr/local/etx/procychains.conf

#dynamic_chain → dynamic_chain
strict_chain → #strict_chain
#random_chain → random_chain
tcp_read_time_out 15000 → tcp_read_time_out 15000000
tcp_connect_time_out 80000 → tcp_connect_time_out 80000000
socks4 127.0.0.1 9050 → socks5 127.0.0.1 9050

 

補足:

※proxychains.confをvimで編集しています。

 

#dynamic_chain → dynamic_chain

#を外してdynamic_chainを有効にしています。

 

strict_chain → #strict_chain

#を付けてstrict_chainを無効にしています

 

tcp_read_time_out 15000 → tcp_read_time_out 15000000

time_outの時間を増やしています。(数値は適当に増やしました。特に変更する必要はないかもしれません)

 

tcp_connect_time_out 80000 → tcp_connect_time_out 80000000

time_outの時間を増やしています。(数値は適当に増やしました。特に変更する必要はないかもしれません)

 

socks4 127.0.0.1 9050 → socks5 127.0.0.1 9050

socks4をsocks5へ変更しています。

使用例

1: sudo proxychains4 curl ifconfig.co

 自分のIPを調べています

github.com