Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动失败 #14

Closed
luyuan2002 opened this issue Oct 21, 2022 · 15 comments
Closed

启动失败 #14

luyuan2002 opened this issue Oct 21, 2022 · 15 comments
Labels
question Further information is requested

Comments

@luyuan2002
Copy link

flutter clean以及flutter pub get命令都试过了,还是报错

# Git最新的代码就是这个版本,无论是手动改成^2.6.1或者2.6.1以及最新版,都是不行
bonfire: 2.6.1

Flutter版本信息:

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [版本 10.0.19044.2130], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
[√] Android Studio (version 2021.2)
[√] IntelliJ IDEA Ultimate Edition (version 2022.1)
[√] Connected device (3 available)
[√] HTTP Host Availability

运行构建命令:

flutter build apk --target-platform android-arm64

错误日志:

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:15:8: Error: Error when reading '/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/tiledjsonreader-1.2.5/lib/map/layer/object_group.dart': 系统找不到指定的文件�?

import 'package:tiledjsonreader/map/layer/object_group.dart';
       ^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:21:8: Error: Error when reading '/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/tiledjsonreader-1.2.5/lib/tile_set/tile_set.dart': 系统找不到指定的文件�?

import 'package:tiledjsonreader/tile_set/tile_set.dart';
       ^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:350:20: Error: Type 'ObjectGroup' not found.
  void _addObjects(ObjectGroup layer) {
                   ^^^^^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:424:42: Error: Type 'TileSet' not found.
  TiledDataObjectCollision _getCollision(TileSet tileSetContain, int index) {
                                         ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:520:5: Error: Type 'TileSet' not found.
    TileSet tileSetContain,
    ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:124:18: Error: 'ObjectGroup' isn't a type.
    if (layer is ObjectGroup) {
                 ^^^^^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:278:5: Error: 'TileSet' isn't a type.
    TileSet? tileSetContain;
    ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:284:24: Error: The getter 'tileSet' isn't defined for the class 'TileSetDetail'.
 - 'TileSetDetail' is from 'package:tiledjsonreader/map/tile_set_detail.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/tiledjsonreader-1.2.5/lib/map/tile_set_detail.dart').   
Try correcting the name to the name of an existing getter, or defining a getter or field named 'tileSet'.
        return tileSet.tileSet != null &&
                       ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:290:37: Error: The getter 'tileSet' isn't defined for the class 'TileSetDetail'.
 - 'TileSetDetail' is from 'package:tiledjsonreader/map/tile_set_detail.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/tiledjsonreader-1.2.5/lib/map/tile_set_detail.dart').   
Try correcting the name to the name of an existing getter, or defining a getter or field named 'tileSet'.
      tileSetContain = findTileset?.tileSet;
                                    ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:350:20: Error: 'ObjectGroup' isn't a type.
  void _addObjects(ObjectGroup layer) {
                   ^^^^^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:424:42: Error: 'TileSet' isn't a type.
  TiledDataObjectCollision _getCollision(TileSet tileSetContain, int index) {
                                         ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:434:43: Error: The getter 'type' isn't defined for the class 'TileSetItem'.
 - 'TileSetItem' is from 'package:tiledjsonreader/tile_set/tile_set_item.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/tiledjsonreader-1.2.5/lib/tile_set/tile_set_item.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'type'.
      String type = tileSetItemList.first.type ?? '';
                                          ^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:520:5: Error: 'TileSet' isn't a type.
    TileSet tileSetContain,
    ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:581:29: Error: The getter 'TileSet' isn't defined for the class 'TiledWorldMap'.
 - 'TiledWorldMap' is from 'package:bonfire/tiled/tiled_world_map.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'TileSet'.
          tileSet.tileSet = TileSet.fromJson(_result);
                            ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/tiled/tiled_world_map.dart:581:19: Error: The setter 'tileSet' isn't defined for the class 'TileSetDetail'.
 - 'TileSetDetail' is from 'package:tiledjsonreader/map/tile_set_detail.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/tiledjsonreader-1.2.5/lib/map/tile_set_detail.dart').   
Try correcting the name to the name of an existing setter, or defining a setter or field named 'tileSet'.
          tileSet.tileSet = TileSet.fromJson(_result);
                  ^^^^^^^
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/util/overlay_manager.dart:43:42: Error: The getter 'value' isn't defined for the class 'OverlayManager'.
 - 'OverlayManager' is from 'package:flame/src/game/overlay_manager.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/flame-1.4.0/lib/src/game/overlay_manager.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
  Set<String> get value => game.overlays.value;
                                         ^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'E:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'E:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 1m 6s
Running Gradle task 'assembleRelease'...                           68.4s
Gradle task assembleRelease failed with exit code 1
@AmosHuKe
Copy link
Owner

AmosHuKe commented Oct 21, 2022

感谢反馈😀,这个问题应该还是bonfire内部tiledjsonreader包版本过高引起的。

正确兼容的版本

tiledjsonreader:
    dependency: transitive
    description:
      name: tiledjsonreader
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.0"

检查方法

在项目根目录pubspec.lock中搜索tiledjsonreader,查看版本是否对应

解决方法

方法一:

将目前项目中pubspec.lock下载并替换到你的本地项目,重新flutter pub get

方法二:

删除本地项目,重新Clone项目

如果还有问题,随时交流~

@AmosHuKe
Copy link
Owner

AmosHuKe commented Oct 21, 2022

#13 合并

@luyuan2002
Copy link
Author

按照这个方法试过了,但是又报了一个新的错误!

$ flutter build apk --target-platform android-arm64
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

 Building with sound null safety

Running Gradle task 'assembleRelease'...
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/util/overlay_manager.dart:43:42: Error: The getter 'value' isn't defined for the class 'OverlayManager'.
 - 'OverlayManager' is from 'package:flame/src/game/overlay_manager.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/flame-1.4.0/lib/src/game/overlay_manager.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
  Set<String> get value => game.overlays.value;
                                         ^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'E:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'E:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 29s
Running Gradle task 'assembleRelease'...                           30.6s
Gradle task assembleRelease failed with exit code 1

这边方便提供一个release apk包的下载地址吗?

@AmosHuKe
Copy link
Owner

按照这个方法试过了,但是又报了一个新的错误!

$ flutter build apk --target-platform android-arm64
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

 Building with sound null safety

Running Gradle task 'assembleRelease'...
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/util/overlay_manager.dart:43:42: Error: The getter 'value' isn't defined for the class 'OverlayManager'.
 - 'OverlayManager' is from 'package:flame/src/game/overlay_manager.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/flame-1.4.0/lib/src/game/overlay_manager.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
  Set<String> get value => game.overlays.value;
                                         ^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'E:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'E:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 29s
Running Gradle task 'assembleRelease'...                           30.6s
Gradle task assembleRelease failed with exit code 1

这边方便提供一个release apk包的下载地址吗?

回复

同刚才的方法一样(链接),bonfire内部flame包版本过高引起的

正确的版本

flame:
    dependency: transitive
    description:
      name: flame
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"

其实你可以把pubspec.lock整个替换成Github上最新的

下载地址

https://github.com/AmosHuKe/Mood-Example/releases

@luyuan2002
Copy link
Author

你好,问题按照你说的已经得到解决!就是不知道为什么我重新git clone了一遍代码,然后他就会修改你这边原来提供的pubspec.lock文件中的版本,才导致不成功的,刚才又按照你发的版本修改了一下,可以了。

@AmosHuKe
Copy link
Owner

哈哈哈哈哈哈,解决了就好,那当前 issue 我就关闭了~

@luyuan2002
Copy link
Author

哈哈哈哈哈哈,解决了就好,那当前 issue 我就关闭了~

好的,感谢!

@yxiangTang
Copy link

按照这个方法试过了,但是又报了一个新的错误!

$ flutter build apk --target-platform android-arm64
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

 Building with sound null safety

Running Gradle task 'assembleRelease'...
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/bonfire-2.6.1/lib/util/overlay_manager.dart:43:42: Error: The getter 'value' isn't defined for the class 'OverlayManager'.
 - 'OverlayManager' is from 'package:flame/src/game/overlay_manager.dart' ('/E:/src/flutter/.pub-cache/hosted/pub.flutter-io.cn/flame-1.4.0/lib/src/game/overlay_manager.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'value'.
  Set<String> get value => game.overlays.value;
                                         ^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'E:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'E:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 29s
Running Gradle task 'assembleRelease'...                           30.6s
Gradle task assembleRelease failed with exit code 1

这边方便提供一个release apk包的下载地址吗?

回复

同刚才的方法一样(链接),bonfire内部flame包版本过高引起的

正确的版本

flame:
    dependency: transitive
    description:
      name: flame
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"

其实你可以把pubspec.lock整个替换成Github上最新的

下载地址

https://github.com/AmosHuKe/Mood-Example/releases

同样的问题我还没解决,替换pubspec.lock后重新 flutter pub get 会还原成
tiledjsonreader:
dependency: transitive
description:
name: tiledjsonreader
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.5"

@AmosHuKe
Copy link
Owner

AmosHuKe commented Nov 9, 2022

@yxiangTang
检查 pubspec.yaml 内是否是 bonfire: 2.6.1,之前错误版本是 bonfire: ^2.6.1(这样会导致自动更新小版本),
然后 pubspec.lock 重新替换。

如果还不行,重新 clone 整个项目重新试试。

@yxiangTang
Copy link

@yxiangTang 检查 pubspec.yaml 内是否是 bonfire: 2.6.1,之前错误版本是 bonfire: ^2.6.1(这样会导致自动更新小版本), 然后 pubspec.lock 重新替换。

如果还不行,重新 clone 整个项目重新试试。

pubspec.yaml 确实是 bonfire: 2.6.1。重新clone 下来,pubspec.yamlbonfire: 2.6.1,运行 flutter pub get pubspec.lock还是会替换成错误版本

@AmosHuKe
Copy link
Owner

AmosHuKe commented Nov 9, 2022

@yxiangTang
可以看看你现在 flutter pub get 之后,pubspec.lockbonfireflametiledjsonreader 的版本么。
像这样的格式书写。

bonfire:
    dependency: "direct main"
    description:
      name: bonfire
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.6.1"

flame:
    dependency: transitive
    description:
      name: flame
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"

tiledjsonreader:
    dependency: transitive
    description:
      name: tiledjsonreader
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.0"

@yxiangTang
Copy link

@yxiangTang 可以看看你现在 flutter pub get 之后,pubspec.lockbonfireflametiledjsonreader 的版本么。 像这样的格式书写。

bonfire:
    dependency: "direct main"
    description:
      name: bonfire
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.6.1"

flame:
    dependency: transitive
    description:
      name: flame
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"

tiledjsonreader:
    dependency: transitive
    description:
      name: tiledjsonreader
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.0"
bonfire:
    dependency: "direct main"
    description:
      name: bonfire
      url: "https://pub.flutter-io.cn"
    source: hosted
    version: "2.6.1"

flame:
    dependency: transitive
    description:
      name: flame
      url: "https://pub.flutter-io.cn"
    source: hosted
    version: "1.4.0"

tiledjsonreader:
    dependency: transitive
    description:
      name: tiledjsonreader
      url: "https://pub.flutter-io.cn"
    source: hosted
    version: "1.2.5"

@AmosHuKe
Copy link
Owner

AmosHuKe commented Nov 9, 2022

@yxiangTang 就这三个,pubspec.lock 内改成我发的对应版本(只改版本号),然后重新 pub get,这样可行么。

@yxiangTang
Copy link

tiledjsonreader

终于可以了,感谢大佬!!!

@AmosHuKe
Copy link
Owner

AmosHuKe commented Nov 9, 2022

@yxiangTang 辛苦你了,他们这个包埋的坑太伤人了哈哈哈哈,解决就好了。

@AmosHuKe AmosHuKe added the question Further information is requested label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants