Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认下载文件路径无法创建 #31

Closed
grliao opened this issue Sep 3, 2017 · 10 comments
Closed

默认下载文件路径无法创建 #31

grliao opened this issue Sep 3, 2017 · 10 comments

Comments

@grliao
Copy link

grliao commented Sep 3, 2017

在华为荣耀6,Android 6.0的版本上,根据默认路径(
/storage/emulated/0/AllenVersionPath/)创建下载文件抛异常的.具体在FileCallBack 的60行.默认为app当前私有目录是可以的.

@AlexLiuSheng
Copy link
Owner

是静默下载?

@AlexLiuSheng
Copy link
Owner

我知道了 这是个bug马上修复

@AlexLiuSheng
Copy link
Owner

compile 'com.allenliu.versionchecklib:library:1.6.3' 你看解决了关闭下issue

@grliao
Copy link
Author

grliao commented Sep 3, 2017

代码逻辑还是有点问题的文件,存在先删除,后续再创建.

@grliao
Copy link
Author

grliao commented Sep 3, 2017

        if (file.exists()) {
            file.delete();
        } else {
            file.createNewFile();
        }

@AlexLiuSheng
Copy link
Owner

现在还是不行吗?之前是少了个动态读写权限申请 这个逻辑是保证每次下载都是重新下载

@grliao
Copy link
Author

grliao commented Sep 3, 2017

是的,错误是:
java.io.FileNotFoundException: /storage/emulated/0/AllenVersionPath/com.allenliu.sample.apk: open failed: EACCES (Permission denied)

@AlexLiuSheng
Copy link
Owner

按理说不会存在这个问题了,库已经做了权限申请,如果不行你自己在项目中先申请权限

@grliao
Copy link
Author

grliao commented Sep 4, 2017

弹出申请权限确认框,导致Activity已经关闭,你把你的demo先删除再安装看看就清楚了.

@AlexLiuSheng
Copy link
Owner

1.6.4已经解决了

@grliao grliao closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants