alibaba / alibaba/flutter_boost

配置了不同环境的入口函数 通过dartEntrypoint方法设置给FlutterBoost,但是在pre环境下找不到我定义的mainPre入口方法,其他的mainDev和main就能找到。

Open
#1,618 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
7.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

## Steps to Reproduce
**flutter工程入口方法**
```
void main() {
}
```

```
void mainDev() {
}
```

```
void mainPre() {
}
```

**入口设置**
```
Platform platform= new FlutterBoost
.忽略其他设置
.dartEntrypoint(“mainPre”)
.build();
FlutterBoost.instance().init(platform);

```

**Flutter Boost Version**:1.17.1
**Target Platform:**
**Target OS version/browser:**
**Devices:**

## Logs
错误log

```
[ERROR:flutter/shell/common/shell.cc(213)] Dart Error: Unhandled exception:
NoSuchMethodError: No top-level getter 'mainPre' declared.
Receiver: top-level
Tried calling: mainDev
#0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:207)

```

## flutter doctor -v
```
[✓] Flutter (Channel stable, v1.17.1, on macOS 12.2.1 21D62, locale zh-Hans-CN)
• Flutter version 1.17.1 at /Users/nowcoder/Flutter/flutter
• Framework revision f7a6a7906b (1 年 10 个月前), 2020-05-12 18:39:00 -0700
• Engine revision 6bc433c6b6
• Dart version 2.8.2


[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/nowcoder/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/nowcoder/Library/Android/sdk
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.2.1, Build version 13C100
• CocoaPods version 1.11.2

[!] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.

[!] VS Code (version 1.65.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

! Doctor found issues in 2 categories.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the three entry points main, mainDev, and mainPre, then configure FlutterBoost with dartEntrypoint("mainPre") as shown. Compare the lookup behavior for mainPre and mainDev using Flutter Boost 1.17.1; done means the pre-environment entry point resolves without the reported NoSuchMethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.