【发布时间】:2020-01-23 22:09:33
【问题描述】:
我正在构建一个使用第三方插件的颤振应用程序。
该插件在其 android java 代码中存在错误。
问题是我找不到有关如何设置开发环境以从我的应用程序中调试插件的文档。
我应该注意到原始开发人员无法重现该错误,因此我需要让它在我的应用程序中运行。
到目前为止,我发现的说明涉及必须构建一个 apk,但这很耗时,而且似乎没有必要。
我是一名经验丰富的 java 和 dart 程序员,所以我在基础知识方面没有遇到任何问题(即我有 Android Studio 和正在运行的 vs 代码,我可以使用它自己的示例代码调试插件)。
这是我到目前为止的过程:
git clone the plugin to my local system.
Within my application add an override in my apps pubspec.yaml to
import the plugin from my local system.
dependency_overrides:
flutter_sound:
path: ../flutter_sound
Build my app so we can open in android studio.
Note: I had to delete my .pub-cache/hosted folder and then run
'flutter pub get' as some older (unused?) packages seem to stop
the build. I also ensure that I had the latest packages for
every package I was using.
flutter build apk
In android studio
Import my app project
- open the android project contained with my app project folder.
e.g.
~/git/app/android
Wait for the gradle build to complete.
Start the android studio debugger and select a simulator.
Open the 'Android Monitor' tab at the bottom of Android Studio.
【问题讨论】:
标签: android debugging flutter plugins