{"id":150,"date":"2016-07-27T09:36:22","date_gmt":"2016-07-27T09:36:22","guid":{"rendered":"https:\/\/boochlin.com\/?p=150"},"modified":"2016-07-27T09:41:38","modified_gmt":"2016-07-27T09:41:38","slug":"react-native-native-android-module-my-god-many-issue","status":"publish","type":"post","link":"https:\/\/boochlin.com\/?p=150","title":{"rendered":"React native Native android module &#8211; my god , many issue."},"content":{"rendered":"<h3><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53485.40.34.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-160\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53485.40.34.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2016-07-27 \u4e0b\u53485.40.34\" width=\"353\" height=\"350\" \/><\/a><\/h3>\n<h3>React native \u7b2c\u4e8c\u5f48 \u4e4b \u5abd\u7684\u9019\u5751\u597d\u591a<\/h3>\n<p>\u76ee\u524d\u9047\u5230\u7684\u5751\u771f\u5fc3\u4e0d\u5c11\uff0c\u6bcf\u6b21\u4e00\u500b\u6539\u7248\u90fd\u662f\u4e00\u5834\u6d69\u52ab\u3002\u4f46\u662f\u5b98\u65b9\u53c8\u5927\u6982\u7dad\u6301\u5169\u9031\u4e00\u6b21\u7684\u6539\u7248\uff0c\u7b2c\u4e09\u65b9\u53c8\u4e0d\u4e00\u5b9a\u90a3\u9ebc\u52e4\u52de\u3002\u90a3\u7206\u6389\u7684\u60c5\u6cc1\u5c31\u4e0d\u5c11\u5566\u3002\u76f8\u4fe1\u4e0d\u5c11\u540c\u4ec1\u90fd\u82b1\u4e0d\u5c11\u6642\u9593\u4e00\u8d77\u5728\u5e6b\u5fd9\u7b2c\u4e09\u65b9\u958b\u6e90 lib debug ,\u4f46\u6211\u8a8d\u70ba\u9019\u5c31\u662f\u958b\u6e90\u8edf\u9ad4\u6700\u5927\u7684\u512a\u9ede\u3002\u4e0b\u9762\u5c31\u96a8\u624b\u7b46\u8a18\u4e00\u4e0b\u3002<\/p>\n<p><!--more--><\/p>\n<h3>1. <a href=\"https:\/\/facebook.github.io\/react-native\/docs\/native-modules-android.html\">Native module Android \u7bc4\u4f8b<\/a><\/h3>\n<p>\u5148\u8aaa\u660e\u60c5\u5883\uff0c\u60f3\u5beb\u500b\u6839\u64da package name \u53bb\u6293 app label name\u3002<br \/>\nreact native &#8211; android<\/p>\n<pre>    @ReactMethod\r\n    public void getLabel(\r\n            String packageName,\r\n            Callback errorCallback,\r\n            Callback successCallback) {\r\n        SharedPreferences spref = this.reactContext.\r\n                getSharedPreferences(this.reactContext.getPackageName() + \"_preferences\", Context.MODE_PRIVATE);\r\n        Log.i(TAG, \"getLabelInvoke package :\"+ packageName + \" isChecked=\" + spref.getBoolean(packageName, false));\r\n        try {\r\n            String appName = (String) reactContext.getPackageManager().getApplicationLabel(\r\n                    reactContext.getPackageManager().getApplicationInfo(packageName, PackageManager.GET_META_DATA));\r\n            successCallback.invoke(appName,spref.getBoolean(packageName, spref.getBoolean(packageName, false)));\r\n        } catch (PackageManager.NameNotFoundException e) {\r\n            errorCallback.invoke(e.getMessage());\r\n        }\r\n    }\r\n    @ReactMethod\r\n    public void getLabel1(\r\n            String packageName,\r\n            Promise promise) {\r\n        SharedPreferences spref = this.reactContext.\r\n                getSharedPreferences(this.reactContext.getPackageName() + \"_preferences\", Context.MODE_PRIVATE);\r\n        Log.i(TAG, \"getLabelInvoke package :\"+ packageName + \" isChecked=\" + spref.getBoolean(packageName, false));\r\n        try {\r\n            String appName = (String) reactContext.getPackageManager().getApplicationLabel(\r\n                    reactContext.getPackageManager().getApplicationInfo(packageName, PackageManager.GET_META_DATA));\r\n\r\n            WritableMap map = Arguments.createMap();\r\n            map.putString(\"label\",appName);\r\n            map.putBoolean(\"enable\",spref.getBoolean(packageName, false));\r\n            promise.resolve(map);\r\n        } catch (PackageManager.NameNotFoundException e) {\r\n            promise.reject(e);\r\n        }\r\n    }\r\n<\/pre>\n<p>react native &#8211; js<\/p>\n<pre>};\r\n  fetchAppLabel(packageName: string) {\r\n    self = this;\r\n    MessageListenerModule.getLabel(packageName,\r\n      (msg: string) =&gt; {\r\n        console.log('Fail to get labe , package:', msg);\r\n      },\r\n      (appLabel: string, enable: boolean) =&gt; {\r\n        console.log('getAppLabel app :', packageName, ':', appLabel, ':', enable);\r\n       }\r\n    );\r\n  }\r\n  async fetchAppLabel1(packageName: string) {\r\n    try {\r\n      let {\r\n        label,\r\n        enable,\r\n      } = await MessageListenerModule.getLabel1(packageName);\r\n      console.log('package:', packageName, ' label:', label);\r\n    } catch (e) {\r\n      console.log(e);\r\n    }\r\n  }\r\n<\/pre>\n<h3>2. <a href=\"https:\/\/github.com\/aksonov\/react-native-router-flux\" target=\"_blank\">react-native-router-flux<\/a>\u00a0 sub scene<\/h3>\n<p>\u88e1\u9762\u7684 <a href=\"https:\/\/github.com\/aksonov\/react-native-router-flux\/blob\/master\/docs\/OTHER_INFO.md\" target=\"_blank\">sub scene<\/a> \u4f7f\u7528\u65b9\u6cd5\u8d85\u96e3\u61c2\u3002 \u4e0d\u77e5\u9053\u6709\u6c92\u6709\u4eba\u5728\u7528 drawer \u642d\u914d\u591a\u5c64 scene \uff0c\u9054\u5230 drawer \u4e0a\u5207\u63db\u4e3b\u985e\u5225\uff0c\u7136\u5f8c\u9032\u5165\u500b\u5b50\u9805\u76ee\u88e1\uff0c\u6309\u7167\u7bc4\u4f8b\u7684\u5beb\u6cd5\uff0c\u6bcf\u6b21\u5207\u63dbdrawer \u9078\u9805\uff0c\u90fd\u6703\u5931\u6557\uff0c\u5982\u679c\u6709\u5b50\u5206\u9801\u7684\u8a71\u3002\u4ee5\u4e0b\u9762\u4f8b\u5b50\u4f86\u8aaa\uff0c\u6bcf\u6b21\u53ea\u8981\u5728 drawer \u4e0a\u5207\u63db\u5230 device config \u9801\u9762\uff0c\u4f60\u6703\u767c\u73fe\u5916\u8868\u662f device config \u7684 list page\uff0c\u4f46\u662f\u5167\u5fc3\u4ed6\u81ea\u5df1\u6703\u4ee5\u70ba\u81ea\u5df1\u662f settings about \u5b50\u5206\u9801\uff0c\u56e0\u6b64\uff0c\u4f60\u4e0d\u7ba1\u600e\u9ebc\u5207\u63db\u90fd\u4e0d\u6703\u6210\u529f\u3002\u9019\u5f88\u660e\u986f\u4e0d\u662f\u6211\u5011\u8981\u7684\u3002\u539f\u56e0\u6211\u4e5f\u4e0d\u77e5\u9053\u3002<a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.36.30.png\"><br \/>\n<\/a><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/Screenshot_20160727-155517.png\"><img decoding=\"async\" class=\"alignnone wp-image-158\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/Screenshot_20160727-155517.png\" alt=\"Screenshot_20160727-155517\" width=\"258\" height=\"459\" \/><\/a><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-154\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.36.30.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2016-07-27 \u4e0b\u53483.36.30\" width=\"606\" height=\"385\" \/><\/p>\n<p>\u5f8c\u4f86\u767c\u73fe\u89e3\u6cd5\uff0c\u5c31\u662f\u9806\u4ed6\u7684\u6bdb\u505a\uff0c\u52a0\u4e00\u500b main \u6700\u70ba\u5b50\u9078\u9805\u7684\u7b2c\u4e00\u9805\u3002<\/p>\n<p><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.43.15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-155\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.43.15.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2016-07-27 \u4e0b\u53483.43.15\" width=\"637\" height=\"411\" \/><\/a><\/p>\n<h3>3. render right button<\/h3>\n<p>\u5448\u4e0a\uff0c\u5f88\u591a\u60c5\u6cc1\u4e0b\uff0c\u4f60\u6703\u60f3\u8981\u81ea\u5df1\u5ba2\u88fd\u5316 router \u4e0a\u7684 right button\uff0c\u50cf\u662f\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\u7684 renderRightButton \uff0c\u5167\u5bb9\u5982\u4e0b\uff0c\u8981\u7279\u5225\u8a18\u4f4f renderRightButton \u7684\u7bc4\u570d\u662f router \u7684\u5de6\u4e0a\u65b9\u70ba\u8d77\u59cb\u9ede\uff0c\u5118\u7ba1\u5b83\u7684\u540d\u7a31\u53eb\u505a renderRightButton\u3002<\/p>\n<p><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/Screenshot_20160727-155634.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-159\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/Screenshot_20160727-155634.png\" alt=\"Screenshot_20160727-155634\" width=\"197\" height=\"349\" \/><\/a><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/Screenshot_20160727-155634.png\"><br \/>\n<\/a><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-156\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.49.53.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2016-07-27 \u4e0b\u53483.49.53\" width=\"657\" height=\"203\" \/><\/p>\n<p>\u70ba\u4e86\u8b93\u4ed6\u8b8a\u6210\u662f right button \uff0c\u56e0\u6b64\u9700\u8981\u5148\u8a2d\u5b9a justifyContent : flex-end \uff0c\u624d\u6703\u5f9e\u53f3\u908a\u958b\u59cb\u7b97\uff0c\u4f46\u662f\u65b0\u7684\u554f\u984c\u5c31\u767c\u751f\u4e86\uff0c\u5c31\u662f\u4f60\u7684 back button \u9ede\u4e0d\u4e0b\u53bb\u4e86\uff0c\u9019\u662f\u56e0\u70ba right button layout \u7684\u7bc4\u570d\u84cb\u5728 back button \u4e0a\u9762\uff0c\u5c0e\u81f4\u6309\u4e0d\u5230\uff0c\u56e0\u6b64\u5fc5\u9808\u7a7a\u51fa\u4e00\u500b\u7bc4\u570d\u7d66 back key button. \u6211\u7684\u505a\u6cd5\u5c31\u662f\u8a2d\u5b9a marginLeft\u3002<\/p>\n<p><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.51.28.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-157\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2016\/07\/\u87a2\u5e55\u5feb\u7167-2016-07-27-\u4e0b\u53483.51.28.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2016-07-27 \u4e0b\u53483.51.28\" width=\"201\" height=\"246\" \/><\/a><\/p>\n<h3>4. React native \u7684 phone call listener error<\/h3>\n<p>\u60f3\u8981\u76e3\u807d phone call \u9032\u4f86\uff0c\u7136\u5f8c\u50b3\u5230 js level\uff0c code \u5982\u4e0b<\/p>\n<p>EventReceiver.java<\/p>\n<pre>public class EventReceiver extends BroadcastReceiver {\r\n    private static final String TAG = \"EventReceiver\";\r\n\r\n    private static boolean incomingFlag = false;\r\n    private static String incoming_number = null;\r\n\r\n    @Override\r\n    public void onReceive(Context context, Intent intent) {\r\n        if (intent.getAction().equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) {\r\n            TelephonyManager tm = (TelephonyManager) context.getSystemService(Service.TELEPHONY_SERVICE);\r\n\r\n            switch (tm.getCallState()) {\r\n                case TelephonyManager.CALL_STATE_RINGING:\r\n                    incomingFlag = true;\r\n                    incoming_number = intent.getStringExtra(\"incoming_number\");\r\n                    Log.i(TAG, \"RINGING :\" + incoming_number);\r\n                    sendIncallNotification(context, true, incoming_number);\r\n                    break;\r\n                case TelephonyManager.CALL_STATE_OFFHOOK:\r\n                    if (incomingFlag) {\r\n                        Log.i(TAG, \"incoming ACCEPT :\" + incoming_number);\r\n                        sendIncallNotification(context, false, incoming_number);\r\n                    }\r\n                    break;\r\n\r\n                case TelephonyManager.CALL_STATE_IDLE:\r\n                    if (incomingFlag) {\r\n                        Log.i(TAG, \"incoming IDLE\");\r\n                        sendIncallNotification(context, false, incoming_number);\r\n                    }\r\n                    break;\r\n            }\r\n        } else if (intent.getAction().equals(Telephony.Sms.Intents.SMS_RECEIVED_ACTION)) {\r\n            Log.i(TAG, \"Receive a new message\");\r\n            Intent serviceIntent = new Intent();\r\n            serviceIntent.setClass(context, NListenerService.class);\r\n            serviceIntent.setAction(NListenerService.SEND_NOTIFICATION_SMS);\r\n            context.startService(serviceIntent);\r\n        } else if (intent.getAction().equals(CalendarContract.ACTION_EVENT_REMINDER)) {\r\n            Log.i(TAG, \"Receive a calendar event\");\r\n            Intent serviceIntent = new Intent();\r\n            serviceIntent.setClass(context, NListenerService.class);\r\n            serviceIntent.setAction(NListenerService.SEND_NOTIFICATION_EVENT);\r\n            context.startService(serviceIntent);\r\n        }\r\n    }\r\n\r\n    private void sendIncallNotification(Context context, boolean stauts, String phoneNumber) {\r\n        Intent serviceIntent = new Intent();\r\n        serviceIntent.setClass(context, NListenerService.class);\r\n        serviceIntent.setAction(NListenerService.SEND_NOTIFICATION_CALL);\r\n        serviceIntent.putExtra(\"status\", stauts);\r\n        serviceIntent.putExtra(\"phoneNumber\", phoneNumber);\r\n        context.startService(serviceIntent);\r\n    }\r\n}\r\n\r\nNListenerService.java\r\n<\/pre>\n<pre>public class NListenerService extends NotificationListenerService {\r\n    private String TAG = \"NListenerService\";\r\n    public final static String SEND_NOTIFICATION_SMS = \"com.android.notification.sendsms\";\r\n    public final static String SEND_NOTIFICATION_EVENT = \"com.android.notification.event\";\r\n    public final static String SEND_NOTIFICATION_CALL = \"com.android.notification.incomingcall\";\r\n    private String mPhoneNumber = \"\";\r\n\r\n\r\n    @Override\r\n    public void onCreate() {\r\n        super.onCreate();\r\n    }\r\n\r\n    @Override\r\n    public void onDestroy() {\r\n        super.onDestroy();\r\n    }\r\n\r\n    @Override\r\n    public int onStartCommand(Intent intent, int flags, int startId) {\r\n        if (intent == null || intent.getAction() == null) {\r\n            return START_STICKY;\r\n        }\r\n\r\n        if (intent.getAction().equals(SEND_NOTIFICATION_SMS)) {\r\n            sendSmsNotification();\r\n        }\r\n\r\n        if (intent.getAction().equals(SEND_NOTIFICATION_EVENT)) {\r\n            sendEventNotification();\r\n        }\r\n\r\n        if (intent.getAction().equals(SEND_NOTIFICATION_CALL)) {\r\n            sendCallNotification(intent.getBooleanExtra(\"status\", false), intent.getStringExtra(\"phoneNumber\"));\r\n            mPhoneNumber = intent.getStringExtra(\"phoneNumber\");\r\n        }\r\n        \/\/ We want this service to continue running until it is explicitly\r\n        \/\/ stopped, so return sticky.\r\n        return START_STICKY;\r\n    }\r\n\r\n    private void sendCallNotification(boolean b, String phoneNumber) {\r\n        SharedPreferences spref =\r\n                getSharedPreferences(getPackageName() + \"_preferences\", Context.MODE_PRIVATE);\r\n        Log.i(TAG, \"sendCallNotification:\" + b);\r\n        Log.i(TAG, \"spref:\" + spref.getBoolean(MessageListenerModule.PHONE_CALL_KEY, true));\r\n        if (spref.getBoolean(MessageListenerModule.PHONE_CALL_KEY, true)) {\r\n\r\n            if (phoneNumber != null) {\r\n                \/\/ TODO : Issue , if app is dismiss from system.\r\n                \/\/ Facebook arch cant init quickly when phone call, will cause error.\r\n                WritableMap params = Arguments.createMap();\r\n                params.putString(\"phoneNumber\", phoneNumber);\r\n                sendEventToJS(MessageListenerModule.JS_EVENT_PHONE_CALL, params);\r\n            }\r\n        }\r\n    }\r\n\r\n    private void sendEventNotification() {\r\n        SharedPreferences spref =\r\n                getSharedPreferences(getPackageName() + \"_preferences\", Context.MODE_PRIVATE);\r\n        if (spref.getBoolean(MessageListenerModule.CALENDAR_KEY, true)) {\r\n\r\n            WritableMap params = Arguments.createMap();\r\n            sendEventToJS(MessageListenerModule.JS_EVENT_CALENDAR, params);\r\n        }\r\n    }\r\n\r\n    @TargetApi(Build.VERSION_CODES.KITKAT)\r\n    private void sendSmsNotification() {\r\n        SharedPreferences spref =\r\n                getSharedPreferences(this.getPackageName() + \"_preferences\", Context.MODE_PRIVATE);\r\n        if (spref.getBoolean(Telephony.Sms.getDefaultSmsPackage(this), false)) {\r\n            WritableMap params = Arguments.createMap();\r\n            params.putString(\"package\", Telephony.Sms.getDefaultSmsPackage(this));\r\n            sendEventToJS(MessageListenerModule.JS_EVENT_SMS, params);\r\n        }\r\n    }\r\n\r\n    @TargetApi(Build.VERSION_CODES.KITKAT)\r\n    @Override\r\n    public void onNotificationPosted(StatusBarNotification sbn) {\r\n        Log.i(TAG, \"onNotificationPosted:\" + sbn.getPackageName());\r\n\r\n        String packageName = sbn.getPackageName();\r\n        SharedPreferences spref =\r\n                getSharedPreferences(this.getPackageName() + \"_preferences\", Context.MODE_PRIVATE);\r\n        Log.i(TAG, \"onNotificationPosted:\" + \"isChecked=\" + spref.getBoolean(packageName, false));\r\n        if (spref.getBoolean(packageName, false) || packageName.equals(Telephony.Sms.getDefaultSmsPackage(this))) {\r\n            WritableMap params = Arguments.createMap();\r\n            params.putString(\"package\", packageName);\r\n            sendEventToJS(MessageListenerModule.JS_EVENT_NOTIFICATION, params);\r\n        }\r\n    }\r\n\r\n    @Override\r\n    public void onNotificationRemoved(StatusBarNotification sbn) {\r\n        Log.i(TAG, \"********** onNOtificationRemoved:\" + sbn.getPackageName());\r\n    }\r\n\r\n    private void sendEventToJS(String eventName,\r\n                               @Nullable WritableMap params) {\r\n        ReactContext reactContext = ((CybertoolApplication) this.getApplicationContext()).getReactContext();\r\n        reactContext\r\n                .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\r\n                .emit(eventName, params);\r\n    }\r\n}\r\n\r\n<\/pre>\n<p>\u9019\u7a0b\u5f0f\u78bc\u6c92\u6709\u554f\u984c\uff0c\u53ea\u8981 app \u6c92\u6709\u88ab kill \u904e\uff0c\u5982\u679c app \u88ab\u79fb\u51fa memory \uff0c \u90a3\u9ebc\u5728 service \u958b\u59cb\u8655\u7406 phone call event \u5c31\u6703\u62cb\u51fa error \uff0c\u4e3b\u8981\u5c31\u662fphone call event \u662f\u5c6c\u65bc\u5fc5\u9808\u53ca\u6642\u8655\u7406\u7684 event \uff0c \u4f46\u662f\u9019\u6642\u5019 app \u88ab kill \uff0c\u90a3\u9ebc\u7cfb\u7d71\u5fc5\u9808\u99ac\u4e0a init android service \uff0c\u5230\u9019\u968e\u6bb5\u6c92\u6709\u554f\u984c\uff0c\u4f46\u662f react native \u7684 module \u537b\u7121\u6cd5\u4f86\u5f97\u53ca\u3002<\/p>\n<pre>java.lang.ExceptionInInitializerError\r\n\tat com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:39)\r\n\tat com.facebook.react.bridge.NativeMap.(NativeMap.java:22)\r\n\tat com.facebook.react.bridge.Arguments.createMap(Arguments.java:29)\r\n\tat com.acer.android.message.NListenerService.sendCallNotification(NListenerService.java:72)\r\n\tat com.acer.android.message.NListenerService.onStartCommand(NListenerService.java:54)\r\n\tat android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3067)\r\n\tat android.app.ActivityThread.access$2200(ActivityThread.java:154)\r\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1489)\r\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n\tat android.os.Looper.loop(Looper.java:224)\r\n\tat android.app.ActivityThread.main(ActivityThread.java:5526)\r\n\tat java.lang.reflect.Method.invoke(Native Method)\r\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\r\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\r\nCaused by: java.lang.RuntimeException: SoLoader.init() not yet called\r\n\tat com.facebook.soloader.SoLoader.assertInitialized(SoLoader.java:234)\r\n\tat com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:169)\r\n\tat com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:39)\r\n\tat com.facebook.react.bridge.ReactBridge.(ReactBridge.java:31)\r\n<\/pre>\n<p>\u89e3\u6cd5\u4f86\u770b\uff0c\u76ee\u524d\u6c92\u6709\uff1f\u7b49\u5b98\u65b9\uff1f\u4e0d\u7136\u5c31\u662f\u90fd\u5728 android level \u89e3\u6c7a\u3002<\/p>\n<p>\u611f\u8b1d\u6536\u770b\uff0c\u6b61\u8fce\u5206\u4eab<\/p>\n","protected":false},"excerpt":{"rendered":"<p>React native \u7b2c\u4e8c\u5f48 \u4e4b \u5abd\u7684\u9019\u5751\u597d\u591a \u76ee\u524d\u9047\u5230\u7684\u5751\u771f\u5fc3\u4e0d\u5c11\uff0c\u6bcf\u6b21\u4e00\u500b\u6539\u7248\u90fd\u662f\u4e00\u5834\u6d69\u52ab\u3002\u4f46\u662f\u5b98\u65b9\u53c8\u5927\u6982\u7dad\u6301\u5169\u9031\u4e00\u6b21\u7684\u6539\u7248\uff0c\u7b2c\u4e09\u65b9\u53c8\u4e0d\u4e00\u5b9a\u90a3\u9ebc\u52e4\u52de\u3002\u90a3\u7206\u6389\u7684\u60c5\u6cc1\u5c31\u4e0d\u5c11\u5566\u3002\u76f8\u4fe1\u4e0d\u5c11\u540c\u4ec1\u90fd\u82b1\u4e0d\u5c11&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,45,44,25],"tags":[55],"_links":{"self":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/150"}],"collection":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=150"}],"version-history":[{"count":0,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/150\/revisions"}],"wp:attachment":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}