'react-native expo build apk installed but frozen in splash screen

I'm developing my app in expo development client and everything is ok. But when I build android app with expo build:android -t apk and install the app on any device my app freeze at the splash screen(Don't crash) and nothing happens. I rebuild the app several times and reinstall all of the dependencies with npm install but nothing changed. Please help me, tnx.

this error logged with adb logcat:

01-15 21:29:41.673  9877  9877 E e       : Failed to clear legacy OkHttp cache
01-15 21:29:41.673  9877  9877 E e       : java.io.IOException: not a readable directory: /data/user/0/com.myapp.myapp/files/okhttp
01-15 21:29:41.673  9877  9877 E e       :  at okhttp3.internal.io.FileSystem$1.deleteContents(FileSystem.java:7)
01-15 21:29:41.673  9877  9877 E e       :  at okhttp3.internal.cache.DiskLruCache.delete(DiskLruCache.java:2)
01-15 21:29:41.673  9877  9877 E e       :  at okhttp3.Cache.delete(Cache.java:1)
01-15 21:29:41.673  9877  9877 E e       :  at host.exp.exponent.q.e.b(ExponentNetwork.kt:4)
01-15 21:29:41.673  9877  9877 E e       :  at host.exp.exponent.q.e.<init>(ExponentNetwork.kt:10)
01-15 21:29:41.673  9877  9877 E e       :  at host.exp.exponent.m.a.<init>(NativeModuleDepsProvider.kt:6)
01-15 21:29:41.673  9877  9877 E e       :  at host.exp.exponent.m.a$a.b(NativeModuleDepsProvider.kt:2)
01-15 21:29:41.673  9877  9877 E e       :  at k.a.a.b.<init>(Exponent.kt:5)
01-15 21:29:41.673  9877  9877 E e       :  at k.a.a.b.<init>(Exponent.kt:37)
01-15 21:29:41.673  9877  9877 E e       :  at k.a.a.b$c.e(Exponent.kt:3)
01-15 21:29:41.673  9877  9877 E e       :  at host.exp.exponent.d.onCreate(ExpoApplication.kt:9)
01-15 21:29:41.673  9877  9877 E e       :  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1122)
01-15 21:29:41.673  9877  9877 E e       :  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6619)
01-15 21:29:41.673  9877  9877 E e       :  at android.app.ActivityThread.-wrap2(Unknown Source:0)
01-15 21:29:41.673  9877  9877 E e       :  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
01-15 21:29:41.673  9877  9877 E e       :  at android.os.Handler.dispatchMessage(Handler.java:108)
01-15 21:29:41.673  9877  9877 E e       :  at android.os.Looper.loop(Looper.java:166)
01-15 21:29:41.673  9877  9877 E e       :  at android.app.ActivityThread.main(ActivityThread.java:7529)
01-15 21:29:41.673  9877  9877 E e       :  at java.lang.reflect.Method.invoke(Native Method)
01-15 21:29:41.673  9877  9877 E e       :  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
01-15 21:29:41.673  9877  9877 E e       :  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

here is my package.json:

{
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@config-plugins/react-native-ble-plx": "0.0.1",
    "@eva-design/eva": "^2.1.1",
    "@miblanchard/react-native-slider": "^2.1.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@ui-kitten/components": "^5.1.1",
    "@ui-kitten/eva-icons": "^5.1.1",
    "axios": "^0.24.0",
    "buffer": "^6.0.3",
    "expo": "^43.0.2",
    "expo-app-loading": "^1.2.1",
    "expo-dev-client": "^0.6.3",
    "expo-font": "^10.0.3",
    "expo-location": "^13.0.4",
    "expo-splash-screen": "~0.13.5",
    "expo-status-bar": "~1.1.0",
    "expo-svg-uri": "^1.3.1",
    "expo-updates": "~0.10.13",
    "immutability-helper": "^3.1.1",
    "moti": "^0.17.1",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-live-clock": "^5.3.1",
    "react-native": "0.64.3",
    "react-native-animated-bar": "^0.2.0",
    "react-native-arc-progress-bar": "^1.2.0",
    "react-native-base64": "^0.2.1",
    "react-native-ble-plx": "^2.0.3",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-range-slider-expo": "^1.4.0",
    "react-native-reanimated": "^2.3.0-beta.3",
    "react-native-redash": "^2.0.0",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.9.0",
    "react-native-svg": "12.1.1",
    "react-native-vector-icons": "^9.0.0",
    "react-native-web": "0.17.1",
    "react-navigation": "^4.4.4",
    "react-navigation-stack": "^2.10.4",
    "react-redux": "^7.2.6",
    "redux": "^4.1.2",
    "uglify-es": "^3.3.9"
  },
  "resolutions": {
    "uglify-es": "3.3.9"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "react-native-svg-transformer": "^0.14.3"
  },
  "private": true,
  "name": "myapp",
  "version": "1.0.2"
}

and app.json:

{
  "expo": {
    "plugins": ["@config-plugins/react-native-ble-plx"],
    "name": "myapp",
    "slug": "myapp",
    "version": "1.0.2",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      },
      "package": "com.myapp.myapp"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source