Giter Club home page Giter Club logo

Comments (7)

shimingzhishang avatar shimingzhishang commented on May 18, 2024 1

我也遇到了,apk文件不要放在CacheDirectorye 换到SD卡 ExternalStorageDirectory 就好了。

from open_file.

crazecoder avatar crazecoder commented on May 18, 2024

首先确定apk包有没有问题,建议先在文件管理器里找到apk点击安装试试,然后确定apk所在路径是否正确

from open_file.

siberiawolf avatar siberiawolf commented on May 18, 2024

我保存到位置就是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.

crazecoder avatar crazecoder commented on May 18, 2024

我保存到位置就是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.

Turing-bei avatar Turing-bei commented on May 18, 2024

有没有解决呢,我也出现了这个问题?

from open_file.

crazecoder avatar crazecoder commented on May 18, 2024

本issue时间跨度过长,现在关闭,如果新版本还存在此问题,请提交新的issue

from open_file.

yjt1216 avatar yjt1216 commented on May 18, 2024

STREAM CLOSED

from open_file.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.