帖子
帖子
用户
博客
课程
显示全部楼层
27
帖子
0
勋章
266
Y币

[多端开发] 安卓手机下载app,packageinfo is null

[复制链接]
发表于 2023-9-13 13:41:11
packageinfo is null     


有些手机正常,有些手机不正常,会出现packageinfo is null     




api.download({
                                url: item.android_url,
                                savePath: 'fs://download1/' + android_url,
                                report: true,
                                cache: true,
                                allowResume: true
                            }, function (ret, err) {
                                console.log(JSON.stringify(ret))
                                if (ret.state == 1) {
                                    that.list[index].finish_percent = ret.progress + '%'
                                    api.toast({
                                        msg: '下载完毕!'
                                    })
                                    setTimeout(function () {
                                        console.log('111---')
                                        that.list[index].is_downloading = false
                                        api.installApp({
                                            appUri: 'fs://download1/' + android_url
                                        });
                                    }, 500)
                                } else {
                                    that.list[index].finish_percent = ret.progress + '%'
                                }
                            });



    40.png



是不是没有下载完成,下载完成后,看一下有这个文件吗。或者延时多点试试。
api.installApp({ appUri: ret.savePath });  这么写试试
12
帖子
0
勋章
213
Y币
请教下,解决了吗?同遇到这样的问题
您需要登录后才可以回帖 登录

本版积分规则