Comments (7)
我也遇到了,apk文件不要放在CacheDirectorye 换到SD卡 ExternalStorageDirectory 就好了。
from open_file.
首先确定apk包有没有问题,建议先在文件管理器里找到apk点击安装试试,然后确定apk所在路径是否正确
from open_file.
我保存到位置就是ExternalStorageDirectory目录,但是打开之后,依然提示软件包解析问题
final directory = await getExternalStorageDirectory();
String _localPath = directory.path;
final taskId = await FlutterDownloader.enqueue(
url: 'http://www.ionic.wang/jdshop.apk',
savedDir: _localPath,
showNotification:
true, // show download progress in status bar (for Android)
openFileFromNotification:
true, // click on notification to open downloaded file (for Android)
);
FlutterDownloader.registerCallback(downloadCallback);
// 打开文件
OpenFile.open('${_localPath}/jdshop.apk');
开启调试后,显示到调试信息。
DownloadWorker{url=http://www.ionic.wang/jdshop.apk,filename=null,savedDir=/storage/emulated/0/Android/data/com.example.flutter_study/files,header=,isResume=false
D/DownloadWorker( 7918): Update notification: {notificationId: 1, title: http://www.ionic.wang/jdshop.apk, status: 2, progress: 0}
D/DownloadWorker( 7918): Open connection to http://www.ionic.wang/jdshop.apk
D/DownloadWorker( 7918): Content-Type = application/octet-stream
D/DownloadWorker( 7918): Content-Length = 3142878
D/DownloadWorker( 7918): Charset = null
D/DownloadWorker( 7918): Content-Disposition = null
D/DownloadWorker( 7918): fileName = jdshop.apk
from open_file.
我保存到位置就是ExternalStorageDirectory目录,但是打开之后,依然提示
软件包解析问题
final directory = await getExternalStorageDirectory(); String _localPath = directory.path; final taskId = await FlutterDownloader.enqueue( url: 'http://www.ionic.wang/jdshop.apk', savedDir: _localPath, showNotification: true, // show download progress in status bar (for Android) openFileFromNotification: true, // click on notification to open downloaded file (for Android) ); FlutterDownloader.registerCallback(downloadCallback); // 打开文件 OpenFile.open('${_localPath}/jdshop.apk');
开启调试后,显示到调试信息。
DownloadWorker{url=http://www.ionic.wang/jdshop.apk,filename=null,savedDir=/storage/emulated/0/Android/data/com.example.flutter_study/files,header=,isResume=false D/DownloadWorker( 7918): Update notification: {notificationId: 1, title: http://www.ionic.wang/jdshop.apk, status: 2, progress: 0} D/DownloadWorker( 7918): Open connection to http://www.ionic.wang/jdshop.apk D/DownloadWorker( 7918): Content-Type = application/octet-stream D/DownloadWorker( 7918): Content-Length = 3142878 D/DownloadWorker( 7918): Charset = null D/DownloadWorker( 7918): Content-Disposition = null D/DownloadWorker( 7918): fileName = jdshop.apk
确认2点
1、是否是android10以上设备(存储机制变更)
2、是否是真实路径
from open_file.
有没有解决呢,我也出现了这个问题?
from open_file.
本issue时间跨度过长,现在关闭,如果新版本还存在此问题,请提交新的issue
from open_file.
STREAM CLOSED
from open_file.
Related Issues (20)
- Namespace not specified.
- The file cannot be opened and there is no error message HOT 5
- open_file 3.3.2: OpenFilePlugin.java uses or overrides a deprecated API. HOT 2
- not working in android 33 HOT 5
- Security: fileprovider allow access to all app files
- Localization issue with iOS modal in open_file package HOT 2
- Android 33 version not open file error HOT 1
- open_file requires MANAGE_EXTERNAL_STORAGE which is considered Dangerous HOT 5
- Add mobi and epub support. HOT 1
- A compile warning
- [Request] Add support for .ipa files like .apk files
- Keyboard become invisible when you open file with active keyboard (IOS) HOT 1
- Why OpenFile requires Multidex support?
- Cannot open file in app bundle? HOT 1
- webData isn't defined
- AGP 8 namespace issue HOT 1
- Cannot build apk
- how to load assets file
- How to open .avi on iOS?
- Windows mp4 video
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open_file.