LoginSignup
7
2

More than 3 years have passed since last update.

Unknown argument type '__attribute__' in method -[RCTAppState getCurrentAppState:error:]

Posted at

うざい赤エラーが出続ける

僕の場合はXcodeをアップデートしたらエラーが出るようになりました。

Unknown argument type '__attribute__' in method -[RCTAppState getCurrentAppState:error:]. Extend RCTConvert to support this type. -[RCTModuleMethod processMethodSignature] RCTModuleMethod.mm:369 -[RCTModuleMethod invokeWithBridge:module:arguments:] facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) _dispatch_call_block_and_release _dispatch_client_callout _dispatch_main_queue_callback_4CF __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ __CFRunLoopRun CFRunLoopRunSpecific GSEventRunModal UIApplicationMain main start

正しい対処方法

React Nativeのバージョンを上げると解決します。
確か0.60.0とか

応急処置

事情があってアップグレードできない場合は、node_modules/react-native/React/base/RCTModuleMethod.mmを以下のように変更すると動く。

RCTModuleMethod.mm
// 91行目
static BOOL RCTParseUnused(const char **input)
{
  return RCTReadString(input, "__unused") ||
         RCTReadString(input, "__attribute__((__unused__))") || // この行を追加
         RCTReadString(input, "__attribute__((unused))");
}
7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2