react-native-blob-util
react-native-blob-util copied to clipboard
Error opening APK file: installation package is corrupt
Click Install package in the drop-down notification bar and it will install normally, While using actionViewIntent occurred error: the program is not installed , the package is damaged.Here's part of my code:
const downloadNewApp = () => {
const android = ReactNativeBlobUtil.android
let dirs = ReactNativeBlobUtil.fs.dirs
ReactNativeBlobUtil.config({
addAndroidDownloads: {
useDownloadManager: true,
title: 'APP Downloading',
description: 'APK ',
mime: 'application/vnd.android.package-archive',
mediaScannable: true,
notification: true,
path: dirs.DownloadDir + '/app-release.apk',
fileCache: true,
}
}).fetch('GET', `http://172.16.10.32:3000/public/apk/NAGW_APP/app-release.apk`).then((res) => {
res.data.length > 0 && android.actionViewIntent(res.path(), 'application/vnd.android.package-archive')
}).catch((error) => console.error(error));
}
"dependencies": {
"@react-native-community/netinfo": "^11.3.1",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@rneui/base": "^4.0.0-rc.8",
"@rneui/themed": "^4.0.0-rc.8",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-blob-util": "^0.19.8",
"react-native-device-info": "^10.13.1",
"react-native-safe-area-context": "^4.9.0",
"react-native-screens": "^3.30.1",
"react-native-vector-icons": "^10.0.3",
},
Android version 7.1.2