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

启动黑屏 #1426

Open
calvin2021y opened this issue Jun 11, 2022 · 0 comments
Open

启动黑屏 #1426

calvin2021y opened this issue Jun 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@calvin2021y
Copy link

calvin2021y commented Jun 11, 2022

使用的 Kraken 版本

0.10.5

fluter 2.8.1

重现步骤

step1: flutter create myapp

step2: add kraken: '>= 0.0.1'

step3: flutter pub get

step4: flutter build apk --target-platform android-arm64

重现代码

import 'package:flutter/material.dart';
import 'package:kraken/kraken.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    var s = """var text1 = document.createTextNode('Hello Kraken!');
var br = document.createElement('br');
var text2 = document.createTextNode('你好,北海!');
var p = document.createElement('p');
p.className = 'p';
p.style.textAlign = 'center';
p.appendChild(text1);
p.appendChild(br);
p.appendChild(text2);

document.body.appendChild(p);""";
    Kraken kraken = Kraken(bundle: KrakenBundle.fromContent(s));

    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: kraken
    );
  }
}

预期结果

apk安装启动后显示ui

实际结果

apk安装启动后直接黑屏

@calvin2021y calvin2021y added the bug Something isn't working label Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant