简体   繁体   English

Flutter Android Studio 中缺少设备文件资源管理器选项

[英]Device File Explorer option missing in Flutter Android Studio

I want to view the database files in my adb device but the option of device file explorer is missing in android studio when flutter project is opened.我想在我的 adb 设备中查看数据库文件,但是打开 flutter 项目时,android studio 中缺少设备文件资源管理器的选项。 But the same is visible when i open android module or simply an android project.I want to view the device files in flutter project itself但是当我打开 android 模块或只是一个 android 项目时,同样是可见的。我想在 flutter 项目本身中查看设备文件

Open Flutter project and check the Event Log if Android framework is detected.如果检测到 Android 框架,请打开 Flutter 项目并检查事件日志。 If so, click Configure and you're done.如果是这样,请单击配置并完成。

  1. Go to Project Structure .转到Project Structure

在此处输入图片说明

  1. Click tab Modules on the left sidebar.单击左侧边栏上的选项卡Modules
  2. Click your project and click the plus icon.单击您的项目,然后单击plus图标。

在此处输入图片说明

  1. Add Android in the FrameworkFramework添加Android

在此处输入图片说明

  1. Click OK to finish.单击OK完成。

Ref: https://github.com/flutter/flutter-intellij/issues/4994#issuecomment-856999849参考: https : //github.com/flutter/flutter-intellij/issues/4994#issuecomment-856999849

I'm experiencing the same problem, and I haven't found a real solution for it.我遇到了同样的问题,我还没有找到真正的解决方案。

The least inconvenient workaround I've found is to create a new "blank" Android project, and then simply using "File -> Open Recent >" and open it in a new Android Studio window whenever I need to use the Device File Explorer.我发现的最不方便的解决方法是创建一个新的“空白”Android 项目,然后只需使用“文件 -> 打开最近 >”并在需要使用设备文件资源管理器时在新的 Android Studio 窗口中打开它。

You can still keep the Flutter project open in the existing Android Studio window and switch between them.您仍然可以在现有的 Android Studio 窗口中保持 Flutter 项目处于打开状态并在它们之间切换。

The below steps works for me以下步骤对我有用

Go to file>Project Structure>module inside module click on add icon and select Android and click OK转到文件>项目结构>模块内的模块单击添加图标并选择Android并单击确定

This will add the Device file explorer in android studio这将在 android studio 中添加设备文件资源管理器

I followed the advice at the top of this conversation (Add Android to File>Project Structure>Module).我遵循了本次对话顶部的建议(将 Android 添加到文件>项目结构>模块)。 When I tried to start the Device File Explorer I also got the error message "Error initializing ADB: Android Debug Bridge not found"当我尝试启动设备文件资源管理器时,我也收到错误消息“初始化 ADB 时出错:找不到 Android 调试桥”

I went back into File>Project Structure>Project and saw that Android SDK was missing.我回到 File>Project Structure>Project,发现 Android SDK 不见了。 I do not know why it was not added when I created the Flutter 2.5 project with Web, Windows and Mobile targets.我不知道为什么在我创建带有 Web、Windows 和 Mobile 目标的 Flutter 2.5 项目时没有添加它。 I added an SDK that matched my emulator (28, Pie).我添加了一个与我的模拟器匹配的 SDK(28,Pie)。 That added the ADB and the Device File Explorer.添加了 ADB 和设备文件资源管理器。 I admit that I am not sure this is the best answer, but it appears to work.我承认我不确定这是最好的答案,但它似乎有效。

This fixes the problem for me:这为我解决了问题:

  • Open File -> Project Structure打开文件 -> 项目结构
  • In Project, select valid Project SDK在 Project 中,选择有效的 Project SDK
  • In Modules -> my_app-> Dependencies -> select a valid Module SDK.在 Modules -> my_app-> Dependencies -> 选择一个有效的 Module SDK。

My solution.我的解决方案。 It is necessary to put android virtual device into root mode.有必要将android虚拟设备置于root模式。 For example сommand for windows 10 .例如windows 10 First run you virtual device.首先运行你的虚拟设备。

Open terminal打开终端

cd %USERPROFILE%\AppData\Local\Android\sdk\platform-tools
adb root
adb devices

Then use previus solution - Open or create a new android native project , after Device File Explorer it will appear in View-> Tool Windows然后使用以前的解决方案-打开或创建一个新的android native project ,在Device File Explorer它会出现在View-> Tool Windows

If Device File Explorer option is not visible at the bottom right, Open AVD Manager如果设备文件资源管理器选项在右下角不可见,请打开 AVD 管理器

在此处输入图片说明

Make sure that the AVD is running, then press the Folder icon for your AVD:确保 AVD 正在运行,然后按 AVD 的文件夹图标: 在此处输入图片说明

Device File Explorer should be visible now:现在应该可以看到设备文件资源管理器:

在此处输入图片说明

It always shows error: Error initializing ADB: Android Debug Bridge not found when selecting Device File Explorer in flutter project here, so I have to open android module to access emulator files:它总是显示错误: Error initializing ADB: Android Debug Bridge not found when select Device File Explorer in flutter project here,所以我必须打开android模块才能访问模拟器文件:

Step 1. Create a dummy android.iml file under android folder步骤 1. 在android文件夹下创建一个虚拟的android.iml文件

在此处输入图片说明

Step 2. Click Open for Editing in Android Studio to open android module in another windows步骤 2. 点击Open for Editing in Android Studio在另一个窗口中打开 android 模块

在此处输入图片说明

Step 3. Start emulator from AVD manager步骤 3. 从 AVD 管理器启动模拟器

在此处输入图片说明

Step 4. Click on emulator tab, make sure the emulator appears here步骤 4. 单击emulator选项卡,确保模拟器出现在这里

在此处输入图片说明

Step 5. Click on Device File Explorer tab to access emulator files步骤 5. 单击Device File Explorer选项卡以访问仿真器文件

在此处输入图片说明

以管理员身份运行 Android Studio 解决了我的问题...

Just found out the easier way to do that all stuffs.刚刚发现了做所有事情的更简单的方法。 You can open the .idea/modules.xml folder in your root project folder.您可以打开根项目文件夹中的.idea/modules.xml文件夹。 it will looks like something like this它看起来像这样

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
   <component name="ProjectModuleManager">
        <modules>
          <module fileurl="file://$PROJECT_DIR$/your_project_name.iml" filepath="$PROJECT_DIR$/your_project_name.iml" />
        </modules>
   </component>
 </project>

add this module below the existing module在现有模块下方添加此模块

<module fileurl="file://$PROJECT_DIR$/android/your_project_name_android.iml" filepath="$PROJECT_DIR$/android/your_project_name_android.iml" />

then it will look like this然后它看起来像这样

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
   <component name="ProjectModuleManager">
        <modules>
          <module fileurl="file://$PROJECT_DIR$/your_project_name.iml" filepath="$PROJECT_DIR$/your_project_name.iml" />
          <module fileurl="file://$PROJECT_DIR$/android/your_project_name_android.iml" filepath="$PROJECT_DIR$/android/your_project_name_android.iml" />
        </modules>
   </component>
</project>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android 工作室的设备文件资源管理器中缺少数据库文件夹 - database folder is missing in device file explorer in android studio Android Studio - 设备文件资源管理器图片目录 - Android Studio - Device File Explorer Picture Directory 如何在没有Android Studio的情况下启动Android设备文件资源管理器? - How to start Android Device File Explorer without Android Studio? Android Studio-Android设备监视器的文件资源管理器不起作用 - Android Studio - Android Device Monitor's File explorer not working 如何在Android Studio(3.0.1)/设备文件资源管理器中打开sqlite文件 - How to open a sqlite file in Android Studio (3.0.1) / Device File Explorer android 工作室中没有设备与 flutter - no device in android studio with flutter 更改Android Studio设备文件资源管理器的默认“另存为”文件夹 - Change default 'Save as…' folder of Device File Explorer of Android Studio Android Studio中Device-File-Explorer的作用是什么 - What's role of Device-File-Explorer in Android-Studio 带有设备文件资源管理器的 Android Studio 3.1.2 中的“ADB not found”错误 - “ADB not found” error in Android Studio 3.1.2 with Device File Explorer 如何在Android Studio 3.1.3中将Device File Explorer停靠在侧面? - How to dock Device File Explorer to the side in Android Studio 3.1.3?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM