[英]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.
如果是这样,请单击配置并完成。
Project Structure
.Project Structure
。Modules
on the left sidebar.Modules
。plus
icon.plus
图标。Android
in the Framework
Framework
添加Android
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:这为我解决了问题:
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
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.