【问题标题】:Android app not visible in windows explorer, warning ls: /storage/emulated/: Permission deniedAndroid 应用在 Windows 资源管理器中不可见,警告 ls: /storage/emulated/: Permission denied
【发布时间】:2020-11-01 09:13:41
【问题描述】:

重新安装项目后,我的包在 android studio 设备资源管理器的 sdCard 文件夹中不可见。在卸载之前,这不是问题,我从未对清单中的权限或运行时权限请求进行任何更改。当我使用 Windows 资源管理器并导航到 /android/data 文件夹时,我的包不存在。然而我的应用程序在设备中正常运行。我在 android studio 4.0

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service android:name="com.example.package.MyService"
            android:exported="true"/>

我可以看到我的设备已授予存储权限。

【问题讨论】:

标签: android android-studio android-permissions


【解决方案1】:

在 Android Studio 中,/storage/emulated/0/sdcard 符号链接,因为此目录用于外部存储。您可以通过/sdcard/Android/data/&lt;app_package&gt;访问您要查找的数据

假设设备已插入 SD 卡,您还应该能够在 Android 设备上通过 My Files 访问 SD 卡上的这些文件。

See this question.

【讨论】:

    【解决方案2】:

    你的应用文件夹在 /data/data/你的包名/下

    要查看您必须使用的所有文件夹和没有播放服务的模拟器。 API

    较新的 api 版本中的外观。(Api > 23) https://imgur.com/SClwEEj

    api 版本(Api https://imgur.com/ncIugFb

    您的持久性和临时应用数据现在存储在哪里。 https://imgur.com/JtLGQHL

    【讨论】:

    • 我的包裹不可见。你能澄清一下你说的第二句话是什么意思吗?
    • 我添加了一些截图。您必须使用没有安装游戏商店内容的模拟器。在 avd 管理器中,如果有图标,您会看到模拟器是否有播放商店。如果模拟器没有该图标,则意味着您可以在没有权限的情况下浏览所有文件夹。 Google 使用 Scoped Storage 改变了一些东西。
    • 我使用的是真实设备而不是模拟器。我想访问我的设备(在 Orio 上运行)。但是在我卸载并重新安装该应用程序后,我在 sdCard 中看不到它。你知道为什么吗?
    猜你喜欢
    • 2022-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-22
    • 1970-01-01
    • 2016-01-20
    • 1970-01-01
    • 2020-03-17
    相关资源
    最近更新 更多