RRWallet icon indicating copy to clipboard operation
RRWallet copied to clipboard

Ubuntu 安装到模拟机里面以后,一直显示白屏。请问需要修改什么文件吗?

Open smallyellow165 opened this issue 5 years ago • 11 comments

安装到模拟机里面以后,一直显示白屏。请问需要修改什么文件吗?

android studio控制台里面显示: $ adb shell am start -n "com.renrenbit.rrwallet.inhouse/com.renrenbit.rrwallet.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Waiting for process to come online... Timed out waiting for process to appear on Pixel_3a_API_27 [emulator-5554].

我是用Android studio直接打开android目录,直接安装到模拟器里。

在模拟器里,可以看到安装的app,但是执行的时候就一直显示白屏。 是需要改其他的设置吗。 还是我的安装方式有问题? 多谢了!

有没有大佬可以详细写一下第三步(3.打开Xcode或者Android Studio 运行即可)是怎么做的?

smallyellow165 avatar Feb 16 '20 05:02 smallyellow165

本地是否有使用npm start 启动React Native服务呢?

kufufu9 avatar Feb 16 '20 16:02 kufufu9

本地是否有使用npm start 启动React Native服务呢?

在第二步的时候启动了,但是android模拟器貌似在连接到服务之前就白屏了。 而且服务的控制台一直没有显示"'...load index.js"这一行。 谢谢。

smallyellow165 avatar Feb 16 '20 17:02 smallyellow165

在Android模拟器的浏览器里打开localhost:8081 或者 本机ip:8081, 确认模拟器是否能连上React Native服务

kufufu9 avatar Feb 17 '20 11:02 kufufu9

从模拟器里面, localhost:8081链接不上. 从模拟器里面, 本机ip:8081 可以. 我觉得是我的client有问题,还没有请求React Native服务就已经挂了。 我新建了一个hello world的react native应用,启动rrwallet的React Native服务,在模拟器里打开hello world的react native应用的时候,rrwallet的React Native服务的console里面会出现“ BUNDLE [android, dev] ./index.js100.0% (1190/1190), done.” 在模拟器里打开rrwalet的client app就不会有这行。完全没有反应。

我不太会umeng的那些,所以我在MainApplication里面把initPushSdk();给注释掉了。不知道是不是这个引起的?

--- 这是我的logcat里面的一部分 2020-02-18 00:06:19.310 29105-29105/? W/zygote: Unexpected CPU variant for X86 using defaults: x86 2020-02-18 00:06:19.313 1643-5099/? I/ActivityManager: Start proc 29105:com.renrenbit.rrwallet.inhouse/u0a92 for activity com.renrenbit.rrwallet.inhouse/com.renrenbit.rrwallet.MainActivity 2020-02-18 00:06:19.322 29105-29112/? E/zygote: Failed writing handshake bytes (-1 of 14): Broken pipe .... 2020-02-18 00:06:55.563 6451-6478/? W/MessageQueue: Handler (android.os.Handler) {602c6ce} sending message to a Handler on a dead thread java.lang.IllegalStateException: Handler (android.os.Handler) {602c6ce} sending message to a Handler on a dead thread at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545) at android.os.Handler.enqueueMessage(Handler.java:662) at android.os.Handler.sendMessageAtTime(Handler.java:631) at android.os.Handler.sendMessageDelayed(Handler.java:601) at android.os.Handler.post(Handler.java:357) at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57) at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)

smallyellow165 avatar Feb 18 '20 08:02 smallyellow165

从模拟器里面, localhost:8081链接不上. 从模拟器里面, 本机ip:8081 可以.

ip可以,localhost域名就不行。一般是DNS问题。 尝试配置host 127.0.0.1 localhost 一般可以解决

sanshao avatar Feb 21 '20 03:02 sanshao

谢谢。这个已经设置过了。 从模拟器里面, localhost:8081链接不上的情况只出现在RRWallet的React Native服务。 另外一个app的的React Native服务就可以从localhost:8081连上。

在RRWallet里面我加了下面设置,应该和Localhost也没有关系了。 protected void onCreate(Bundle state){ super.onCreate(state);

SharedPreferences preferences =
    PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
preferences.edit().putString("debug_http_host", "127.0.0.1:8081").apply();

}

smallyellow165 avatar Feb 21 '20 06:02 smallyellow165

Mac 系统下 还需要安装watchman: brew install watchman 完了之后再在ios目录下启动 “npm start”

zhaodong1982 avatar Feb 24 '20 05:02 zhaodong1982

安装完watchman,重启 “npm start”后,碰到如下问题: Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module buffer from /Users/zhaodong/Projects/RRWallet/src/module/wallet/wallet/btc/BTCTransaction.js: Module buffer does not exist in the Haste module map or in these directories: /Users/zhaodong/Projects/RRWallet/node_modules

This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
  4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*. (null))

__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.213 RCTCxxBridge.mm:414 invocation function for block in attemptAsynchronousLoadOfBundleAtURL(NSURL*, void (RCTLoadingProgress*) block_pointer, void (NSError*, RCTSource*) block_pointer) __80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke -[RCTMultipartStreamReader emitChunk:headers:callback:done:] -[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:] -[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:] _CFNetworkHTTPConnectionCacheSetLimit NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK -[NSBlockOperation main] NSOPERATION_IS_INVOKING_MAIN -[NSOperation start] NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION __NSOQSchedule_f _dispatch_block_async_invoke2 _dispatch_client_callout _dispatch_continuation_pop _dispatch_async_redirect_invoke _dispatch_root_queue_drain _dispatch_worker_thread2 _pthread_wqthread start_wqthread

zhaodong1982 avatar Feb 24 '20 05:02 zhaodong1982

安装完watchman,重启 “npm start”后,碰到如下问题: Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module buffer from /Users/zhaodong/Projects/RRWallet/src/module/wallet/wallet/btc/BTCTransaction.js: Module buffer does not exist in the Haste module map or in these directories: /Users/zhaodong/Projects/RRWallet/node_modules

This might be related to facebook/react-native#4968 To resolve try the following:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
  4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*. (null))

__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.213 RCTCxxBridge.mm:414 invocation function for block in attemptAsynchronousLoadOfBundleAtURL(NSURL*, void (RCTLoadingProgress*) block_pointer, void (NSError*, RCTSource*) block_pointer) __80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke -[RCTMultipartStreamReader emitChunk:headers:callback:done:] -[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:] -[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:] _CFNetworkHTTPConnectionCacheSetLimit NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK -[NSBlockOperation main] NSOPERATION_IS_INVOKING_MAIN -[NSOperation start] NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION __NSOQSchedule_f _dispatch_block_async_invoke2 _dispatch_client_callout _dispatch_continuation_pop _dispatch_async_redirect_invoke _dispatch_root_queue_drain _dispatch_worker_thread2 _pthread_wqthread start_wqthread

我在 rm node_modules/ ,然后再运行npm ci 之后,再启动。 模拟器可以正常运行了。

zhaodong1982 avatar Feb 24 '20 05:02 zhaodong1982

谢谢哈。我是Ubuntu. 有人在Ubuntu里面的模拟器上运行成功吗?

smallyellow165 avatar Feb 24 '20 07:02 smallyellow165

修复了在Android 9.0设备上debug时无法连接到metro服务的问题 https://github.com/RenrenBit/RRWallet/commit/025cd41636c95af585a3942c925ab6648ca5fc62

kufufu9 avatar Apr 18 '20 18:04 kufufu9