React-Native应用程序在签名的APK上显示白屏

时间:2018-11-17 13:05:07

标签: android react-native

我有一个React-Native应用,可以在模拟器和设备上的调试模式下正常运行。

我现在想构建一个签名的APK,用于Play商店部署,但APK仅显示白屏。

我通过WebSockets在MacBook中添加了日志记录,因此我可以看到render()componentDidMount()方法都可以使用,

似乎我的整个应用程序都在白屏后面运行。

我在清单文件中添加了android:debuggable="true",在构建gradle中添加了debuggable true,所以当我摇晃设备时,会弹出React-Native开发菜单。当我切换检查器时,什么也没发生,当我尝试在白色屏幕上按时,也什么也没发生。

我正在使用全新安装的 React-Native版本0.57.4

我的logcat输出(为mycompany占用)如下:

11-17 13:17:25.614  2859  2859 I Timeline: Timeline: Activity_launch_request time:27233523 intent:Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mycompany/.MainActivity bnds=[74,600][242,768] (has extras) }
11-17 13:17:25.737 22995 22995 D SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.mycompany-1/lib/arm flags = 0]
11-17 13:17:25.738 22995 22995 D SoLoader: adding backup  source: com.facebook.soloader.ApkSoSource[root = /data/data/com.mycompany/lib-main flags = 1]
11-17 13:17:25.738 22995 22995 D SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.mycompany-1/lib/arm flags = 0]
11-17 13:17:25.738 22995 22995 D SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.mycompany/lib-main flags = 1]
11-17 13:17:25.739 22995 22995 V fb-UnpackingSoSource: locked dso store /data/user/0/com.mycompany/lib-main
11-17 13:17:25.741 22995 22995 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.mycompany/lib-main
11-17 13:17:25.741 22995 22995 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.mycompany/lib-main
11-17 13:17:25.872 22995 22995 D AccessibilityManager: current package=com.mycompany, accessibility manager mIsFinalEnabled=false, mOptimizeEnabled=true, mIsUiAutomationEnabled=false, mIsInterestedPackage=false
11-17 13:17:25.914 22995 23027 W unknown:ReconnectingWebSocket: Couldn't connect to "ws://localhost:8081/message?device=MI%20MAX%202%20-%207.1.1%20-%20API%2025&app=com.mycompany&clientid=DevSupportManagerImpl", will silently retry
11-17 13:17:25.941 22995 23034 D SoLoader: libreactnativejni.so not found on /data/data/com.mycompany/lib-main
11-17 13:17:25.941 22995 23034 D SoLoader: libreactnativejni.so found on /data/app/com.mycompany-1/lib/arm
11-17 13:17:25.962 22995 23034 D SoLoader: libfb.so not found on /data/data/com.mycompany/lib-main
11-17 13:17:25.962 22995 23034 D SoLoader: libfb.so found on /data/app/com.mycompany-1/lib/arm
11-17 13:17:25.963 22995 23034 D SoLoader: libfb.so not found on /data/data/com.mycompany/lib-main
11-17 13:17:25.963 22995 23034 D SoLoader: libfb.so found on /data/app/com.mycompany-1/lib/arm
11-17 13:17:25.963 22995 23034 I art     : Thread[26,tid=23034,Native,Thread*=0xd6945100,peer=0x130119d0,"Thread-3"] recursive attempt to load library "/data/app/com.mycompany-1/lib/arm/libfb.so"
11-17 13:17:25.990  1549  1571 I ActivityManager: Displayed com.mycompany/.MainActivity: +353ms
11-17 13:17:25.999  1549  1571 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{f1eb1f9 u0 com.mycompany/.MainActivity t21113} time:27233909
11-17 13:17:26.169   464   469 E Vold    : Failed to find mounted volume for /dev/null/Android/data/com.mycompany/cache/
11-17 13:17:26.170 22995 23018 W ContextImpl: Failed to ensure /dev/null/Android/data/com.mycompany/cache: 400
11-17 13:17:26.203 22995 23042 D SoLoader: libyoga.so not found on /data/data/com.mycompany/lib-main
11-17 13:17:26.203 22995 23042 D SoLoader: libyoga.so found on /data/app/com.mycompany-1/lib/arm
11-17 13:17:27.342   464   469 E Vold    : Failed to find mounted volume for /dev/null/Android/data/com.mycompany/files/
11-17 13:17:27.344 22995 23041 W ContextImpl: Failed to ensure /dev/null/Android/data/com.mycompany/files: 400
11-17 13:17:27.389 22995 23041 I ReactNativeJS: Running application "mycompany" with appParams: {"rootTag":1}. __DEV__ === false, development-level warningare OFF, performance optimizations are ON

我的依赖看起来像这样:

  "dependencies": {
    "base-64": "^0.1.0",
    "buffer": "5.0.7",
    "glamorous-native": "1.1.2",
    "md5": "2.2.1",
    "moment": "2.18.1",
    "password-validator": "4.0.0",
    "prop-types": "15.6.2",
    "react": "16.6.0-alpha.8af6728",
    "react-native": "0.57.4",
    "react-native-audio": "4.1.3",
    "react-native-datepicker": "1.6.0",
    "react-native-fbsdk": "^0.8.0",
    "react-native-fetch-blob": "0.10.8",
    "react-native-image-picker": "0.26.4",
    "react-native-keep-awake": "2.0.5",
    "react-native-keyboard-aware-scroll-view": "0.3.0",
    "react-native-keyboard-aware-view": "0.0.14",
    "react-native-linear-gradient": "2.4.2",
    "react-native-orientation": "3.0.0",
    "react-native-sentry": "^0.39.1",
    "react-native-sha256": "1.1.1",
    "react-native-sound": "0.10.4",
    "react-native-store-review": "0.1.5",
    "react-native-svg": "6.5.2",
    "react-native-swipe-a-lot": "kay-is/react-native-swipe-a-lot",
    "react-native-video": "3.2.1",
    "redux": "3.7.2",
    "validator": "8.1.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.49.0",
    "react-test-renderer": "16.6.0-alpha.8af6728",
    "ws": "^6.1.0"
  },

我还尝试了不同的FB-SDK版本,该版本没有任何改变。

1 个答案:

答案 0 :(得分:0)

我今天经历了所有的部门。将glamour-native更新到1.4.0版可以解决此问题。