React-native Android:应用程序卡在简历的启动画面上

时间:2018-11-13 14:50:03

标签: android react-native react-navigation

我的应用在恢复后停留在启动屏幕上

  • 启动应用
  • 按回来(转到Android仪表板)
  • 单击应用程序图标
  •   

    应用卡在了屏幕上

这是我的依赖项:

"react-native": "^0.57.4",
"react-native-code-push": "^5.4.2",
"react-native-collapsible": "^1.1.0",
"react-native-datepicker": "^1.7.2",
"react-native-fast-image": "^5.1.0",
"react-native-geocoder": "git://github.com/pizzahutuk/react-native-geocoder",
"react-native-google-analytics-bridge": "^6.1.2",
"react-native-google-autocomplete": "^0.1.5",
"react-native-image-picker": "^0.27.1",
"react-native-iphone-x-helper": "^1.2.0",
"react-native-linear-gradient": "^2.4.2",
"react-native-maps": "git://github.com/react-community/react-native-maps.git#1844d46902629e2caa55527d5bff48a550d92525",
"react-native-picker-select": "^4.4.0",
"react-native-sensors": "^4.0.0",
"react-native-splash-screen": "^3.1.1",
"react-native-svg": "^8.0.8",
"react-native-video": "^3.2.1",
"react-navigation": "^2.16.0",
"react-navigation-redux-helpers": "^2.0.6",
"react-redux": "^5.0.7",
"react-router": "^4.3.1",
"redux": "^4.0.0"

这是发行期间来自adb logcat的日志:

11-13 15:45:30.710 2290 2290 W ResourceType:获取资源号0x9c020204的名称时没有已知的程序包 11-13 15:45:30.710 2290 2290 I HwLauncher:启动器onclick开始com.huawei.android.launcher.BubbleTextView {d7d30af VFED..CL。 ... P..ID 528,1280-792,1570#9c020204} 11-13 15:45:30.710 2290 2290 I HwLauncher:Launcher.Utilities startActivitySafely useLaunchAnimation = true 11-13 15:45:30.710 2290 2290 I HwLauncher:Launcher.Utilities startActivity为当前用户安全地启动startActivity() 11-13 15:45:30.714 2239 2239 I K3V3CpuGovernorPolicy:设置场景Hmp策略:300,150 11-13 15:45:30.717 2290 2290 I HwLauncher:Launcher.Utilities startActivity安全结束当前用户的startActivity() 11-13 15:45:30.717 2290 2290 I HwLauncher:启动器此视图的父级不是SearchGridView,因此不需要reportRecentApp。 11-13 15:45:30.717 2290 2290 I HwLauncher:启动器onclick结束 11-13 15:45:30.719 2290 2290 I HwLauncher:Launcher onPause() 11-13 15:45:30.720 2290 12810 I HwLauncher:Launcher.MotionManager stopMotionAppsReco begin,flg = 403 11-13 15:45:30.720 2290 12810 W HwLauncher:Launcher.MotionManager stopMotionAppsReco服务flg 403不可用 11-13 15:45:30.725 2239 3057 W PGApi_client:recv actoionId = 10000,action = com.huawei.pgmng.PGAction@3b9ef2f actionId = 10000 pkg = air.com.unit9.frappextend1 = 1390 extend2 = flag = 3 type = 1 11-13 15:45:30.726 2290 12809 I HwLauncher:Launcher.MotionManager stopMotionAppsReco begin,flg = 402 11-13 15:45:30.726 2290 12809 W HwLauncher:Launcher.MotionManager stopMotionAppsReco服务flg 402不可用 11-13 15:45:30.729 1893 2018我HwSystemManager:NotificationGuideService:句柄MSG_ACTIVIY_FOREGROUND,uid:10185 11-13 15:45:30.729 10855 10985 I HwSystemManager:NotificationGuideService:handle MSG_ACTIVIY_FOREGROUND,uid:10185 11-13 15:45:30.730 2290 2290 I SendBroadcastPermission:action:com.huawei.android.action.WIDGET_FOCUS_CHANGE,mPermissionType:0 11-13 15:45:30.732 10855 11018 W System.err:android.content.pm.PackageManager $ NameNotFoundException:air.com.unit9.frapp 11-13 15:45:30.732 10855 11018 W System.err:位于android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:321) 11-13 15:45:30.732 10855 11018 W System.err:at com.huawei.systemmanager.netassistant.netapp.service.NetControllService.checkShowNetWorkToast(NetControllService.java:170) 11-13 15:45:30.732 10855 11018 W System.err:at com.huawei.systemmanager.netassistant.netapp.service.NetControllService.access $ 100(NetControllService.java:56) 11-13 15:45:30.732 10855 11018 W System.err:at com.huawei.systemmanager.netassistant.netapp.service.NetControllService $ 1.handleMessage(NetControllService.java:114) 11-13 15:45:30.732 10855 11018 W System.err:at android.os.Handler.dispatchMessage(Handler.java:102) 11-13 15:45:30.732 10855 11018 W System.err:at android.os.Looper.loop(Looper.java:150) 11-13 15:45:30.733 10855 11018 W System.err:at android.os.HandlerThread.run(HandlerThread.java:61) 11-13 15:45:30.737 1893 2093 I Hw资源:加载图标ID:7f0a0000,pkgName:air.com.unit9.frapp 11-13 15:45:30.744 388 1107 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0x933 11-13 15:45:30.744 388 1107 I gralloc:Alloc句柄(0x7f68a58400):interfmt = 0x1,步幅= 1088,大小= 8486912 11-13 15:45:30.745 1893 2093 I HwResources:icon:air.com.unit9.frapp在应用中找到 11-13 15:45:30.745 12692 12738 I ReactNativeJS:运行带有appParams的应用程序“ App”:{“ rootTag”:11}。 DEV ===否,开发级警告已关闭,性能优化已启用 11-13 15:45:30.770 388 12146 I gralloc:自由句柄(0x7f68a42b00) 11-13 15:45:30.770 388 12146 I gralloc:自由句柄(0x7f68a58300) 11-13 15:45:30.771 388 419 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0xb00 11-13 15:45:30.772 388419 I gralloc:Alloc句柄(0x7f68a58600):interfmt = 0x200000001,步幅= 1088,大小= 8486912 11-13 15:45:30.772 388 419 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0xb00 11-13 15:45:30.781 388 419 I gralloc:Alloc句柄(0x7f83e88b00):interfmt = 0x200000001,步幅= 1088,大小= 8486912 11-13 15:45:30.781 388 419 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0xb00 11-13 15:45:30.782 388 419 I gralloc:Alloc句柄(0x7f68a58700):interfmt = 0x200000001,步幅= 1088,大小= 8486912 11-13 15:45:30.788 388 419 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0xb00 11-13 15:45:30.793 388419 I gralloc:Alloc句柄(0x7f68a58800):interfmt = 0x200000001,步幅= 1088,大小= 8486912 11-13 15:45:30.793 388 419 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0xb00 11-13 15:45:30.798 388 419 I gralloc:Alloc句柄(0x7f68a58900):interfmt = 0x200000001,步幅= 1088,大小= 8486912 11-13 15:45:30.798 388 419 I gralloc:Alloc请求:dev = 0x7f83e42540,w = 1080,h = 1920,格式= 0x1,用法= 0xb00 11-13 15:45:30.798 388 419 I gralloc:Alloc句柄(0x7f68a42200):interfmt = 0x200000001,步幅= 1088,大小= 8486912 11-13 15:45:30.819 961 1609 E HwCHRWebMonitor:运行processNameair.com.unit9.frapp 11-13 15:45:30.819 961 1609 E HwCHRWebMonitor:HwCHRWifiUIDWebSpeed [appName = com.mobilesrepublic.appy UID = 10104 WEBSENDSEGS = 9 WEBRESENDSEGS = 0 WEBRECVSEGS = 12 WEBERRSEGS = 0 WEBOUTRSTS = 0 WEBESTABLISRST = 0 WEBRBSDUSERATION = 12 = 0 suckTimes = 0 recovage_times = 0] 11-13 15:45:30.820 961 1609 E HwCHRWebMonitor:HwCHRWifiUIDWebSpeed [appName = com.google.uid.shared:10010 UID = 10010 WEBSENDSEGS = 18 WEBRESENDSEGS = 0 WEBRECVSEGS = 11 WEBERRSEGS = 0 WEBOUTRSTS = 0 WEBESTABLISRST = 40 WEBRTTDURATION WEBRTTSEGS = 9 WEBSNDDUPACKS = 0 suckTimes = 0 recovage_times = 0] 11-13 15:45:30.820 961 1609 E HwCHRWebMonitor:HwCHRWifiUIDWebSpeed [appName = com.google.uid.shared:10010 UID = 1010010 WEBSENDSEGS = 0 WEBRESENDSEGS = 0 WEBRECVSEGS = 1 WEBERRSEGS = 0 WEBOUTRSTS = 0 WEBESTABLISRST = 0 WEBRTTDURATION WEBRTTSEGS = 0 WEBSNDDUPACKS = 0 suckTimes = 0 recovage_times = 0] 11-13 15:45:30.820 961 1609 E HwCHRWebMonitor:HwCHRWifiUIDWebSpeed [appName = com.meraki.sm UID = 1010109 WEBSENDSEGS = 28 WEBRESENDSEGS = 0 WEBRECVSEGS = 24 WEBERRSEGS = 0 WEBOUTRSTS = 0 WEBESTABLISRST = 0 WEBSTTDUGS = 15 = 0 suckTimes = 0 recovage_times = 0] 11-13 15:45:30.820 961 1609 E HwCHRWebMonitor:HwCHRWifiUIDWebSpeed [appName = air.com.unit9.frapp UID = 10185 WEBSENDSEGS = 40 WEBRESENDSEGS = 0 WEBRECVSEGS = 28 WEBERRSEGS = 0 WEBOUTRSTS = 0 WEBESTABLISRST = 0 WEBRTTSERATION = 182 17 WEBSNDDUPACKS = 0 suckTimes = 0 recovage_times = 0] 11-13 15:45:30.820 961 1609 E HwCHRWebMonitor:WebMonitor [mNetWorkIsSuck = false mUIDIsSuck =] WebSpeed [WEBSENDSEGS = 132 WEBRESENDSEGS = 8 WEBRECVSEGS = 89 WEBERRSEGS = 0 WEBOUTRSTS = 5 WEBESTABLISRST = 0 WEBRTTSEGST == 860 WEBSNDDUPACKS = 0 SENDSEGS = 0 RESENDSEGS = 0 RECVSEGS = 0 ERRSEGS = 0 OUTRSTS = 0 ESTABLISRST = 0 RTTDURATION = 0 RTTSEGS = 0 SNDDUPACKS = 0 suckTimes = 0 recovage_times = 0] 11-13 15:45:30.844 961 1084 I ActivityManager:显示air.com.unit9.frapp / .MainActivity:+ 124ms 11-13 15:45:30.898 12692 12738 I ReactNativeJS:[CodePush]正在检查更新。 11-13 15:45:30.903 12692 12705我的艺术:对象分配现在很忙,因此在增长堆之前。新的堆大小为45 MB 11-13 15:45:30.919 12692 12738 I ReactNativeJS:{“ event”:“ gaevent”,“ eventparameters”:{“ category”:“ TAB”,“ action”:“ Accueil”,“ label”:“ Page Accueil “,”值“:0,”非交互“:false}} 11-13 15:45:30.921 12692 12738 I ReactNativeJS:[CodePush]报告二进制更新(2.0) 11-13 15:45:30.962 12692 12705我的艺术:对象分配现在很忙,因此在增长堆之前。新的堆大小为54 MB 11-13 15:45:31.006 2290 2290 I HwLauncher:启动器mUnlockScreenRunnbale getOrientationEnabled false 11-13 15:45:31.006 2290 2290 I HwLauncher:Launcher onStop() 11-13 15:45:31.025 961 1572 E WifiConfigStore:updateConfiguration freq = 5200 BSSID = 8a:15:14:74:7c:f2 RSSI = -39“ tiptopdev” WPA_PSK 11-13 15:45:31.027 961 1618 I HuaweiWifiWatchdogStateMachine:spd正常计数:0,添加sc:0.0,速率:1.0 11-13 15:45:31.027 961 1618 I HuaweiWifiWatchdogStateMachine:当前mHighDataFlowRate = 1.0 11-13 15:45:31.028 961 1618 I HuaweiWifiWatchdogStateMachine:POta txb txg rxg:0,58,0. Lr = 0%Totpkt = 58 11-13 15:45:31.028 961961 I WifiProJNI:######### CMD_QUERY_PKTS ######## 11-13 15:45:31.028 961 1616 I QosMonitor:postEventFromNative:msg = 100,arg1 = 0,arg2 = 9 11-13 15:45:31.028 961 1616 W WifiProJNI:轮询之前:g_monitor_fd = 175 11-13 15:45:31.030 961 1618 I HuaweiWifiWatchdogStateMachine:PTcp RTT:860,rtt pkt = 17,tcp_rx = 30,tcp_tx = 45,tcp_reTran = 0,rtRate = 0 11-13 15:45:31.030 961 1618 I HuaweiWifiWatchdogStateMachine:pkt chk不错,将sc重置为0。 11-13 15:45:31.030 961 1618 I HuaweiWifiWatchdogStateMachine:网速不错 11-13 15:45:31.030 961 1618 I HuaweiWifiWatchdogStateMachine:判断良好链接######,goodLinkLevel = 3 11-13 15:45:31.030 961 1618 I HuaweiWifiWatchdogStateMachine:sendResultMsgToQM bssid:8a:15::7c:f2,qoslevel = 3 11-13 15:45:31.030 961 1618 I HuaweiWifiWatchdogStateMachine:链接报告良好,基本rssi:-39 11-13 15:45:31.035 388 388我gralloc:自由句柄(0x7f68a42e00) 11-13 15:45:31.051 388 388 I gralloc:自由句柄(0x7f68a58400) 11-13 15:45:31.132 12692 12738 I ReactNativeJS:[CodePush]报告状态失败:{“ appVersion”:“ 2.0”} 11-13 15:45:31.133 12692 12738 I ReactNativeJS:[CodePush]发生未知错误。 11-13 15:45:31.134 12692 12738 I ReactNativeJS:[CodePush] 400:更新检查必须包含有效的部署密钥-请检查您的应用程序是否已正确配置。要查看可用的部署密钥,请运行“ code-push部署ls -k”。 11-13 15:45:31.333 12692 12738 I ReactNativeJS:{“ event”:“ pageview”,“ page”:{“ category”:“ Home”,“ path”:“”,“ title”:“ tip top法国“}} 11-13 15:45:31.428 2239 2239 I K3V3CpuGovernorPolicy:设置场景Hmp策略:665,256 11-13 15:45:31.968 961961 I TrafficMonitor:更新:rxPkts:9,txPkts:7,rxBytes:4525,txBytes:1574 11-13 15:45:31.968 961 961 I TrafficMonitor:启动已过期。 1级 11-13 15:45:31.968 961 961 I TrafficMonitor:gettimer:interval = 2000 11-13 15:45:32.338 961 1572 E WifiConfigStore:updateConfiguration freq = 5200 BSSID = 8a:15:14:74:7c:f2 RSSI = -38“ tiptopdev” WPA_PSK

有什么主意吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

您应该通过SplashScreen.hide()函数调用componentDidMount()

您可以根据需要添加延迟,例如:

import { InteractionManager } from 'react-native';

...

componentDidMount() {

  // Some code here if needed.

  InteractionManager.runAfterInteractions(() => {
    setTimeout(() => {
      SplashScreen.hide();
    }, 750);
  });
}

如果必须从componentDidUpdate()调用它(因为需要准备一些数据),只需调用它即可,而不是从if语句内部调用。如果启动画面已经消失,SplashScreen.hide()不会造成任何伤害。

(请记住,在第一个渲染之后componentDidUpdate()不会被调用,而在第二个渲染之后才被调用)