React-native应用在模拟器上启动,但不在设备上

时间:2019-10-25 00:43:13

标签: android react-native nullpointerexception emulation device

本机android应用程序正在模拟器上运行,但不在设备上运行。

该应用程序同步完美,没有任何构建错误。

我尝试删除库,取消链接,再次重新链接,清理android应用,使缓存无效并重新启动,清除对本机缓存的反应并再次使用npm install。很多东西。向Androidmanifest.xml文件添加更多权限。但实际上,它们都不起作用。

通过Android Studio调试时,没有问题。经过MainApplication和MainActivity中的所有断点后,只是该应用程序停留在启动屏幕上。

项目中使用的库:

package.json文件:

           {
  "name": "xyz",
  "version": "0.0.1",
  "private": true,
  "scripts": {
  "android": "react-native run-android",
  "ios": "react-native run-ios",
  "start": "react-native start",
  "test": "jest",
  "lint": "eslint ."
  },
 "dependencies": {
 "firebase": "^7.2.1",
 "react": "16.9.0",
 "react-native": "0.61.2",
 "react-native-freshchat-sdk": "^2.1.1",
 "react-native-gesture-handler": "^1.4.1",
 "react-native-onesignal": "^3.4.2",
 "react-native-screens": "^2.0.0-alpha.3",
 "react-native-splash-screen": "^3.2.0",
 "react-native-vector-icons": "^6.6.0",
 "react-native-webview": "^7.4.0",
 "react-navigation": "^4.0.10",
 "react-navigation-drawer": "^2.2.2",
 "react-navigation-stack": "^1.9.4",
 "react-navigation-tabs": "^2.5.6"
 },
 "devDependencies": {
 "@babel/core": "7.6.2",
 "@babel/runtime": "7.6.2",
 "@react-native-community/eslint-config": "0.0.3",
 "babel-jest": "24.9.0",
 "eslint": "6.5.0",
 "jest": "24.9.0",
 "metro-react-native-babel-preset": "0.51.1",
 "react-test-renderer": "16.9.0"
 },
 "jest": {
 "preset": "react-native"
 }
}

错误:

  BUILD SUCCESSFUL in 52s

156个可执行任务:已执行11个,最新145个 信息连接到开发服务器... 信息在“设备”上启动应用程序... 开始:意图{cmp = com.xyz / .MainActivity} java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法'boolean java.lang.String.equals(java.lang.Object)'         在android.os.Parcel.readException(Parcel.java:1552)         在android.os.Parcel.readException(Parcel.java:1499)         在android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2663)         在com.android.commands.am.Am.runStart(Am.java:766)         在com.android.commands.am.Am.onRun(Am.java:305)         在com.android.internal.os.BaseCommand.run(BaseCommand.java:47)         在com.android.commands.am.Am.main(Am.java:97)         在com.android.internal.os.RuntimeInit.nativeFinishInit(本机方法)         在com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)

期望它也可以在Android设备上运行,但未运行。

0 个答案:

没有答案