8000 在release模式下,call library级别的方法,编译出错。 · Issue #12 · XianyuTech/aspectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

在release模式下,call library级别的方法,编译出错。 #12

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

Closed
8000
galaxybruce opened this issue Sep 3, 2019 · 4 comments
Closed

Comments

@galaxybruce
Copy link

@kangwang1988
反复测试发现一个问题,我给一个library方法添加call aop,debug模式下能正常编译,而且运行结果也正确。release模式下,出现“Dart snapshot generator failed with exit code -6”错误,生成的app.dill文件,转为txt查看了下,也是正确的,但是最后在flutter/bin/flutter中出错。
以下是我的测试代码:
image

image

错误日志:
image

@kangwang1988
Copy link
Contributor
kangwang1988 commented Sep 3, 2019

@galaxybruce
我看了下最新的flutter master代码:

kylewong@KyleWongdeMacBook-Pro flutter % flutter doctor -v
KWLM:doctor -v
[✓] Flutter (Channel master, v1.9.8-pre.54, on Mac OS X 10.15 19A546d, locale en-CN)
    • Flutter version 1.9.8-pre.54 at /Users/kylewong/Codes/Flutter/alibaba-flutter/flutter
    • Framework revision 16fcb83fec (4 hours ago), 2019-09-02 23:44:41 -0400
    • Engine revision e7f9ef6aa0
    • Dart version 2.5.0 (build 2.5.0-dev.4.0 36985859e4)

下是没有问题的,debug/release(ios/android)都测了下。
Demo代码:
main.dart

void appInit() async{
}

void main() {
//  appInit();
  runApp(MyApp());
}
import 'package:aspectd/aspectd.dart';

@Aspect()
@pragma("vm:entry-point")
class ExecuteDemo {
  @pragma("vm:entry-point")
  ExecuteDemo();

  @Execute("package:example/main.dart", "_MyHomePageState", "-_incrementCounter")
  @pragma("vm:entry-point")
  void _incrementCounter(PointCut pointcut) {
    pointcut.proceed();
    print('[KWLM1] called!');
  }

  @Execute("package:example/main.dart", "", "+appInit")
  @pragma("vm:entry-point")
  void appInit(PointCut pointcut) {
    pointcut.proceed();
    print('[KWLM2] called!');
  }
}

@galaxybruce
Copy link
Author

我使用的的flutter版本是1.7.8
Execute是正常的,Call不可以。

@kangwang1988 kangwang1988 added the bug Something isn't working label Sep 3, 2019
@kangwang1988 kangwang1988 self-assigned this Sep 3, 2019
@kangwang1988
Copy link
Contributor

@galaxybruce
appInit的aop方法需要声明是static的。我刚更新了下README,框架本身没有bug.

@kangwang1988 kangwang1988 removed the bug Something isn't working label Sep 3, 2019
@kangwang1988 kangwang1988 removed their assignment Sep 3, 2019
@itlwy
Copy link
itlwy commented Nov 28, 2020

@galaxybruce 你好,我现在编译release也你这个类似的错,debug是正常的,请问你那都解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0