【问题标题】:How to properly import Open Source projects in Flutter?如何在 Flutter 中正确导入开源项目?
【发布时间】:2019-04-25 18:17:06
【问题描述】:

我正在学习 Flutter,我想导入一个开源项目来学习一些结构等。

项目为:https://github.com/matthewtory/trinity-orientation-2018

我正在使用 Android Studio,到目前为止,我可以创建自己的项目并通过手机运行它们,但是当我想导入这个项目时,我收到了很多错误和警告。该应用程序已完成并且还在 Play 商店中,为什么它不在我的 IDE 中运行?我错过了什么吗?

错误信息是:

Launching lib\main.dart on SM G960F in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\Users\marcs\AndroidStudioProjects\trinity-orientation-2018-master\android\gradlew.bat" exited abnormally:
firebase_storage
firebase_messaging
url_launcher
camera
path_provider
cloud_firestore
shared_preferences
image_picker
firebase_core
firebase_auth


FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\marcs\AndroidStudioProjects\trinity-orientation-2018-master\android\app\build.gradle' line: 16

* What went wrong:
A problem occurred evaluating project ':app'.
> versionCode not found. Define flutter.versionCode in the local.properties file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
  Command: C:\Users\marcs\AndroidStudioProjects\trinity-orientation-2018-master\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

我下载了项目并将文件夹导入 Android Studio。它首先要求获取我所做的依赖项,然后我立即尝试在手机上运行它。

随时查看 Github 项目上的代码。我没有改变任何东西。我希望通过运行这个项目来了解动画和导航概念。

【问题讨论】:

    标签: import flutter project


    【解决方案1】:

    错误消息说您必须定义版本代码。尝试将以下行添加到您的 local.properties 文件(在 android 文件夹下)

    flutter.versionName=1.0.0

    flutter.versionCode=1

    您可能会遇到其他错误,但至少这将解决您问题中的错误。如果您收到其他错误消息,请分享。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-14
      • 1970-01-01
      • 2018-04-26
      • 1970-01-01
      • 2021-03-13
      • 2013-06-03
      • 1970-01-01
      相关资源
      最近更新 更多