React Native: Unfortunately, Application has stopped

安稳与你 提交于 2021-02-08 08:20:13

问题


My app worked properly !

When run android The application is compiled without error, but returns the message when it's displayed.

Unfortunately, application has stopped

It happened when i install and link these two packages

react-native-push-notification AND react-native-google-analytics-bridge

{
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  },
  "name": "Melkana",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@ptomasroos/react-native-multi-slider": "0.0.14",
    "expo": "^28.0.0",
    "expo-analytics": "^1.0.7",
    "lodash": "^4.17.10",
    "react": "16.3.1",
    "react-native": "0.55.3",
    "react-native-check-box": "^2.1.0",
    "react-native-elements": "^0.19.1",
    "react-native-google-places-autocomplete": "^1.3.6",
    "react-native-map-clustering": "^1.3.0",
    "react-native-maps": "*",
    "react-native-modal-picker": "0.0.16",
    "react-native-simple-radio-button": "^2.7.2",
    "react-native-ui-kitten": "^3.0.1",
    "react-native-vector-icons": "^4.6.0",
    "react-navigation": "^2.0.2",
    "rn-sliding-up-panel": "^1.2.1"
  },
  "devDependencies": {
    "babel-jest": "22.4.3",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.3",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

When run this in Android Studio look this logged errors at Logcat

E/AndroidRuntime: FATAL EXCEPTION: Thread-1480 Process: com.melkana, PID: 11733 java.lang.NoSuchMethodError: No static method loadLibrary(Ljava/lang/String;)V in class Lcom/facebook/soloader/SoLoader; or its super classes (declaration of 'com.facebook.soloader.SoLoader' appears in /data/app/com.melkana-2/base.apk)

at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:18)

at com.facebook.react.bridge.NativeMap.(NativeMap.java:19)

at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create (JSCJavaScriptExecutorFactory.java:21)

at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:912)

at java.lang.Thread.run(Thread.java:818)


回答1:


Solution:

In the app/build.gradle

implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.facebook.fresco:animated-gif:1.9.0'
// IN CASE YOU NEED WEBP SUPPORT / MAKE SURE TO CHANGE THIS TOO TO 1.9.0
implementation 'com.facebook.fresco:animated-webp:1.9.0'
implementation 'com.facebook.fresco:webpsupport:1.9.0'

https://github.com/facebook/react-native/issues/20252



来源:https://stackoverflow.com/questions/51389541/react-native-unfortunately-application-has-stopped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!