试图从apk读取文件而不是从androidstudio-emulator读取文件时出现奇怪的错误。

问题描述 投票:0回答:1

我有一个Android Kotlin App,可以从以下地方读取JSON。https:/www.androdocs.comfilesuploadsoriginalsample-json-data-1567767983.txt

当我使用完全相同的应用程序,并从阅读。http:/www.makumaku.detest.txt

但如果我从手机上测试apk,我只能读取第一个txt文件,第二个-txt文件的结果是白屏。

-> 为什么是这样的,我怎么能使 http:/www.makumaku.detest.txt -文件在手机上也能读吗?

android json file android-studio cross-domain
1个回答
0
投票

android:usesCleartextTraffic="true"

是解决方案,如果有人需要它,太

© www.soinside.com 2019 - 2024. All rights reserved.