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

flutter侧白屏 Failed to create platform view rendering surface #34

Closed
wanghao522 opened this issue Aug 24, 2021 · 12 comments
Closed
Assignees

Comments

@wanghao522
Copy link

wanghao522 commented Aug 24, 2021

Describe the bug
platform_view.cc(81):Failed to create platform view rendering surface
swift 项目,native侧 跳转flutter,跳转过去后,界面渲染不出来(白屏),点击界面,上面的按钮可以正常显示,flutter监视器 上可以正常看到按钮大小位置(swift项目,你们demo项目正常,对比了代码木有找到原因,flutter侧代码完全用demo里面的,猜测是native侧的问题)

Expected behavior

Flutter Doctor

OS & Device

  • Device:   真机,模拟器
  • OS: ios14
  • Version:2.0.11
  • flutter ver:2.2.3
  • swift :5.3

Error logs
platform_view.cc(81):Failed to create platform view rendering surface

@foxsofter
Copy link
Contributor

方便的话把你的 native 代码贴上来

@wanghao522
Copy link
Author

wanghao522 commented Aug 25, 2021

image
运行这个宿主项目哈 感谢
hyyy.zip

@foxsofter
Copy link
Contributor

flutter 端的代码呢,这个确实没办法看出来什么,还有接入的方式有点奇怪啊,可能需要先确认下你的编译方式是否正常

@wanghao522
Copy link
Author

flutter 端的代码呢,这个确实没办法看出来什么,还有接入的方式有点奇怪啊,可能需要先确认下你的编译方式是否正常
代码在里面的
image
先执行 cd fluttermodule flutter pub get 然后 cd .. pod install,正规项目接入都是这样的,podfile里面就是这样写的,跟你们demo里面 podflie写法不一样,我接入flutter就是这样弄的(没有接入flutter_thrio时候自己在appdelegate里面初始化flutter engine ,用method_channel 跳转都是好用的,按照你的demo接入后flutter页面渲染不出来)

@foxsofter
Copy link
Contributor

foxsofter commented Aug 25, 2021

你把原生那块的写法改成跟 demo 一样的先试试吧

@wanghao522
Copy link
Author

你把原生那块的写法改成跟 demo 一样的先试试吧
好的 我再试试,但是有如下问题
1.demo 是oc的,我项目是主项目swift的,我主项目工程名字不是Runner 我看过flutter 编译脚本那块,项目名和scheme都是写死的,源码不好改
2.我项目结构不想改的跟demo一样,建议作者可以建立一个swift demo ,给大家个例子,然后podfile 这样写
install! 'cocoapods', :deterministic_uuids => false
platform :ios, '10.0'
inhibit_all_warnings!
use_frameworks!
flutter_path = './fluttermodule'#可以是相对路径也可以是决定路径,指向你创建的flutter的项目
load File.join(flutter_path, '.ios', 'Flutter', 'podhelper.rb')
project 'Runner.xcodeproj'

target 'Runner' do
install_all_flutter_pods(flutter_path)

end
正常混编项目都是这样接入的,官方的也是这样写的

@foxsofter
Copy link
Contributor

你 Flutter 版本是一样的嘛?

@wanghao522
Copy link
Author

你 Flutter 版本是一样的嘛?

一样啊 就装了一个2.2.3版本

@wanghao522
Copy link
Author

你 Flutter 版本是一样的嘛?

一样啊 就装了一个2.2.3版本

@foxsofter
Copy link
Contributor

hyflutterlib 这个啥玩意,你本地的,这份代码我是跑步起来的

@wanghao522
Copy link
Author

hyflutterlib 这个啥玩意,你本地的,这份代码我是跑步起来的

漏删了 没有用到 你删除就行,能跑起来的,但是进入flutter页面黑屏的

@foxsofter
Copy link
Contributor

这依赖内部源吧,确实没跑起来,Swift的例子我demo 也有,你自己调试看看吧,先关闭了

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

2 participants