alexeieleusis / greencat

A port of Redux(https://github.com/reactjs/redux) to Dart, including Redux Thunk(https://github.com/gaearon/redux-thunk) and a simple Logger.
Apache License 2.0
48 stars 4 forks source link

Flutter example does not work with latest Flutter version #10

Open raju-bitter opened 7 years ago

raju-bitter commented 7 years ago

Right now the Flutter example does not work with latest Flutter versions. List of problems:

1. flutter.yaml needs to be merged into pubspec.yaml (easy to fix)

2. Java app class and Activity class not found. There is an exception when the Flutter app gets launched:

I/ActivityManager(  559): Start proc 8285:com.yourcompany.todoListFlutter/u0a123 for activity com.yourcompany.todoListFlutter/org.domokit.sky.shell.SkyActivity
I/art     ( 8285): Late-enabling -Xcheck:jni
D/AndroidRuntime( 8285): Shutting down VM
E/AndroidRuntime( 8285): FATAL EXCEPTION: main
E/AndroidRuntime( 8285): Process: com.yourcompany.todoListFlutter, PID: 8285
E/AndroidRuntime( 8285): java.lang.RuntimeException: Unable to instantiate application org.domokit.sky.shell.SkyApplication: java.lang.ClassNotFoundException: Didn't find class "org.domokit.sky.shell.SkyApplication" on path: DexPathList[[zip file "/data/app/com.yourcompany.todoListFlutter-1/base.apk"],nativeLibraryDirectories=[/data/app/com.yourcompany.todoListFlutter-1/lib/arm, /vendor/lib, /system/lib]]
E/AndroidRuntime( 8285):    at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
E/AndroidRuntime( 8285):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4526)
E/AndroidRuntime( 8285):    at android.app.ActivityThread.access$1500(ActivityThread.java:151)
E/AndroidRuntime( 8285):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
E/AndroidRuntime( 8285):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 8285):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 8285):    at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime( 8285):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8285):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 8285):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime( 8285):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime( 8285): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.domokit.sky.shell.SkyApplication" on path: DexPathList[[zip file "/data/app/com.yourcompany.todoListFlutter-1/base.apk"],nativeLibraryDirectories=[/data/app/com.yourcompany.todoListFlutter-1/lib/arm, /vendor/lib, /system/lib]]
E/AndroidRuntime( 8285):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime( 8285):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime( 8285):    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/AndroidRuntime( 8285):    at android.app.Instrumentation.newApplication(Instrumentation.java:980)
E/AndroidRuntime( 8285):    at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
E/AndroidRuntime( 8285):    ... 10 more
E/AndroidRuntime( 8285):    Suppressed: java.lang.ClassNotFoundException: org.domokit.sky.shell.SkyApplication
E/AndroidRuntime( 8285):        at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 8285):        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/AndroidRuntime( 8285):        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/AndroidRuntime( 8285):        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime( 8285):        ... 13 more
E/AndroidRuntime( 8285):    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
W/ActivityManager(  559):   Force finishing activity 1 com.yourcompany.todoListFlutter/org.domokit.sky.shell.SkyActivity

The AndroidManifest.xml uses the old classes Sky class names instead of e.g. io.flutter.app.FlutterApplication.

3. FlexDirection.vertical getter not found The correct property is now Axis.direction (main.dart, line #43).

4. ERROR: The argument type '(dynamic) → GestureDetector' can't be assigned to the parameter type '(Todo) → dynamic'. ([todo_list_flutter] lib/main.dart:32)

Flutter framework version Flutter • channel master • https://github.com/flutter/flutter.git Framework • revision 7843afd4d6 (50 minutes ago) • 2017-03-15 07:08:42 Engine • revision b97103b441 Tools • Dart 1.23.0-dev.2.0

Running flutter doctor... [✓] Flutter (on Linux, channel master) • Flutter at /home/raju/dev/flutter • Framework revision 7843afd4d6 (50 minutes ago), 2017-03-15 07:08:42 • Engine revision b97103b441 • Tools Dart version 1.23.0-dev.2.0

raju-bitter commented 7 years ago

Created a PR fixing all problems. https://github.com/alexeieleusis/greencat/pull/11

alexeieleusis commented 7 years ago

There are still a few open issues and a throughout review is needed for the flutter example, I will leave this open to keep track of it. Thanks for the PR!