-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
@dcharkes Remind me after you upload android binaries. I need to revert download urls. @dcharkes @mannprerak2 Flutter support for Android, Linux and Windows is available now. I'm excluding flutter example from But, we will not be able to publish this to pub.dev as I haven't mentioned the flutter version in pubspec. If I add flutter version, we will fail to do Possible approaches -
Reference: dart-lang/pub#2606 |
To add MacOS support, maybe we can try doing this - cd example/flutter
flutter create --platforms=macos --project-name=cronet_example . And, this (should) meet our target 😃. Tell me if it works. |
In my opinion, the |
@mannprerak2 I'll miss dart cli then 😢 . Hope pub.dev fixes it soon. Other changes are done too :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my reference (so that I know which files to review): Which files were generated by flutter create
and were not modified? And which files where either modified or not generated by flutter create
?
private lateinit var channel : MethodChannel | ||
|
||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { | ||
System.loadLibrary("cronet.86.0.4240.198") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we loading these in Kotlin rather than using DynamicLibrary.open
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do not load it using Kotlin first, we get this error -
F/chromium(17045): [0418/210141.455792:FATAL:jni_android.cc(96)] Check failed: g_jvm.
Though we're not using Platform Channel from our side in our package itself. Loading the library via Kotlin first then doing DynamicLibrary.open
on Dart side fixes the issue. (I'm yet to figure out why this is happening though.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference: unsuitable001/dart_cronet_sample#3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds similar to this: flutter/flutter#73318
Lets just keep it for now and file an issue to look at it later.
@@ -0,0 +1,16 @@ | |||
# cronet_example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this boilerplate readme with a description of what the Flutter example is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll delete the cli example as we're going flutter only for now :). So, I'll delete this readme file also and pub will index the actual code under Example
tab by it's own. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only Flutter? The Dart CLI things just keep working if you have a dart
on your path correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I try to do dart run
, I get -
Resolving dependencies...
Because example_dart depends on cronet from path which requires the Flutter
SDK, version solving failed.
Flutter users should run `flutter pub get` instead of `pub get`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. It does work.
If I do - dart run bin/example_dart.dart
it works.
But, if I do dart run
, it gives the error I mentioned above. Keep the CLI example then. :)
Can we add some See https://github.com/google/webcrypto.dart repo. |
Generated but modified -
Modified (not generated) -
Anything not listed here is generated boilerplate. |
README.md
Outdated
@@ -6,13 +6,14 @@ This is a [GSoC 2021 project](https://summerofcode.withgoogle.com/projects/#4757 | |||
|
|||
## Supported Platforms | |||
|
|||
Currently, 64 bit Desktop Platforms (Linux, Windows and MacOS) are supported. | |||
Currently, Android and 64 bit Desktop Platforms (Linux, Windows and MacOS) are supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about x86 Android when using the Android Emulator from Android studio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those binaries are added too, both x86 and x86_64. (I'll try to test on the emulator).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not working on x86 emulator :( Getting HttpException with some negative long random value as error status code. Maybe we should mention this and probably need to do some modifications in the wrapper to support 32 bit systems overall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file an issue to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: #20
Tested using https://github.com/marketplace/actions/flutter-action This one is the most popular (if we're considering 3rd party Github Actions) |
@dcharkes All done.
That implies, Is there any known issue in flutter regarding this? |
Why do we need to link against dart.lib? We're using the |
Oops 😅 It was already removed for Linux/Mac. Removed it. CI passed 😄 |
private lateinit var channel : MethodChannel | ||
|
||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { | ||
System.loadLibrary("cronet.86.0.4240.198") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds similar to this: flutter/flutter#73318
Lets just keep it for now and file an issue to look at it later.
@@ -0,0 +1,7 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you leave comments on what lines of the file were added/modified from the generated file? That way it will be easier to deal with conflicts etc. if the Flutter project needs to be updated in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I mentioned this file in the above comment. It isn't modified by me. But, other paths are correct. I did a copy paste mistake with android/src/main/AndroidManifest.xml
.
Anyways, I added it to the correct file :)
@@ -0,0 +1,44 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you leave comments on what lines of the file were added/modified from the generated file? That way it will be easier to deal with conflicts etc. if the Flutter project needs to be updated in the future.
android/src/main/AndroidManifest.xml
Outdated
@@ -0,0 +1,6 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||
package="dev.google.cronet"> | |||
<!-- Flutter Boilerplate Modifications: Internet & Netwrok Permissions--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the another modified file that I mis-"copy pasted" with another manifest file's path.
android/src/main/AndroidManifest.xml
Outdated
@@ -1,6 +1,6 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||
package="dev.google.cronet"> | |||
<!-- Flutter Boilerplate Modifications: Internet & Netwrok Permissions--> | |||
<!-- Flutter Boilerplate Modifications: Internet & netwrok Permissions--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
netwrok -> network (it was the spelling I meant, not the capitalization 🙈 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops 😓 my bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the binaries and I'll change the download url and commit both the changes together 🙈. 1 less task for our CI vm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we need the jars for in the Android binaries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need those jar files too :) Again, I need to refer this issue: unsuitable001/dart_cronet_sample#3
I don't know the exact reason. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm re-testing it on my device and I'll paste the exact error log here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried in 3 variation. Logs below.
Attempt 1: Include jar files but do not load the .so
files from kotlin.
Output: Crashing as soon as it's getting launch. Only getting
http://127.0.0.1:34017/YTBP04h-Lu4=/
Attempt 2: Remove jars but load so
files from kotlin
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk... 8.9s
F/chromium(21501): [0804/174650.092879:FATAL:jni_android.cc(138)] Failed to find class J/N
F/chromium(21501): #00 pc 0x00000000002e09bf /data/app/dev.google.cronet_example-ZSU7uPvW02OfcK8Ob4tYpQ==/lib/arm64/libcronet.86.0.4240.198.so
F/chromium(21501): #01 pc 0x00000000002eb60f /data/app/dev.google.cronet_example-ZSU7uPvW02OfcK8Ob4tYpQ==/lib/arm64/libcronet.86.0.4240.198.so
F/chromium(21501): #02 pc 0x00000000003418af /data/app/dev.google.cronet_example-ZSU7uPvW02OfcK8Ob4tYpQ==/lib/arm64/libcronet.86.0.4240.198.so
F/chromium(21501): #03 pc 0x00000000001e1aa3 /data/app/dev.google.cronet_example-ZSU7uPvW02OfcK8Ob4tYpQ==/lib/arm64/libcronet.86.0.4240.198.so
F/chromium(21501): #04 pc 0x00000000002c1a3f /system/lib64/libart.so
F/chromium(21501): #05 pc 0x000000000000403b /system/lib64/libopenjdkjvm.so
F/chromium(21501): #06 pc 0x0000000000000bcb /system/framework/arm64/boot-core-oj.oat
F/chromium(21501):
Error connecting to the service protocol: failed to connect to
http://127.0.0.1:37607/pQcwEtK-emc=/
Attempt 3: Remove jars and do not load .so
files from kotlin
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk... 7.4s
I/OpenGLRenderer(21802): Davey! duration=906ms; Flags=1, IntendedVsync=29271908984223, Vsync=29272625650861, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=29272634604821, AnimationStart=29272634798155, PerformTraversalsStart=29272634807217, DrawStart=29272653090655, SyncQueued=29272657276280, SyncStart=29272657438155, IssueDrawCommandsStart=29272657732217, SwapBuffers=29272812535446, FrameCompleted=29272815417269, DequeueBufferDuration=11718000, QueueBufferDuration=765000,
F/libc (21802): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 21827 (1.ui), pid 21802 (.cronet_example)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'asus/WW_X00TD/ASUS_X00T_2:9/PKQ1/16.2017.2009.087-20200826:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 21802, tid: 21827, name: 1.ui >>> dev.google.cronet_example <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 0000000000000000 x1 00000078b2bfac78 x2 0000000000010002 x3 00000078a7281588
x4 00000078a7281500 x5 0000007950719f88 x6 00000078a72814f0 x7 0000000000000000
x8 0f5c9418fa297d4e x9 0f5c9418fa297d4e x10 0000000000000001 x11 0000000000000000
x12 00000078a7281500 x13 00000078a72814f0 x14 0000000000004100 x15 aaaaaaaaaaaaaaab
x16 00000078a7a6ced0 x17 000000795071b040 x18 0000000000000001 x19 00000078a7a74000
x20 0000000000000002 x21 00000078b2bfc588 x22 00000078b1108041 x23 00000078b4755b90
x24 00000078b1108041 x25 00000078b2b1e000 x26 00000078b2bfc588 x27 00000078a7387430
x28 0000000000000004 x29 00000078b2bfaca0
sp 00000078b2bfac50 lr 00000078a7717ca8 pc 00000078a78773a4
backtrace:
#00 pc 00000000003413a4 /data/app/dev.google.cronet_example-1jJaFkoD6WqfgexC4ieOzA==/lib/arm64/libcronet.86.0.4240.198.so
#01 pc 00000000001e1ca4 /data/app/dev.google.cronet_example-1jJaFkoD6WqfgexC4ieOzA==/lib/arm64/libcronet.86.0.4240.198.so
#02 pc 00000000002baba8 /data/app/dev.google.cronet_example-1jJaFkoD6WqfgexC4ieOzA==/lib/arm64/libcronet.86.0.4240.198.so
#03 pc 0000000000006694 <anonymous:00000078b1080000>
Syncing files to device ASUS X00TD... ⣾
Lost connection to device.
Syncing files to device ASUS X00TD... 702ms
Oops; flutter has exited unexpectedly: "getIsolate: (112) Service has
disappeared".
⣻Oops; flutter has exited unexpectedly: "getIsolate: (112) Service has
disappeared".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah of course, we're compiling that Kotlin helper code to a jar. Silly me. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcharkes Links are updated!
Add Flutter Support, covering all of the native platforms.
Platforms -
MacOS & iOS will be done separately.
This PR only takes care of 64bit systems. For 32 bit systems, issue #20 should be tracked.
Reference #5