flutter_tflite icon indicating copy to clipboard operation
flutter_tflite copied to clipboard

Migrate to support Android V2 embedding

Open erikbg7 opened this issue 3 years ago • 17 comments

Migration guideline: https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration

Current issues: https://github.com/shaqian/flutter_tflite/issues/220 https://github.com/shaqian/flutter_tflite/issues/224

erikbg7 avatar Sep 24 '21 16:09 erikbg7

When will you support android v2 embedding?

ss-zheng avatar Oct 01 '21 20:10 ss-zheng

Yes any update on android v2 embedding?

kartikeyaa-k avatar Oct 06 '21 16:10 kartikeyaa-k

Same question here

DennisKragekjaer avatar Oct 18 '21 07:10 DennisKragekjaer

 package io.flutter.plugins.firebasecoreexample;

 import io.flutter.embedding.android.FlutterActivity;
 import io.flutter.embedding.engine.FlutterEngine;
 import io.flutter.plugins.firebase.core.FirebaseCorePlugin;

 public class MainActivity extends FlutterActivity {
   // You can keep this empty class or remove it. Plugins on the new embedding
   // now automatically registers plugins.
 }

Puspharaj avatar Oct 19 '21 19:10 Puspharaj

can you tell me where to add these lines ? @Puspharaj

rafay-tariq avatar Oct 24 '21 13:10 rafay-tariq

can you tell me where to add these lines ? @Puspharaj

I just pointed out that, It can be implemented in that way as suggested by the flutter team. However the whole plugin needs to be restructured to meet current guidelines of the flutter. I have just forked. I need to restructure the plugin. It takes time.

But only v2 embedding error thrown out, App can be build with those errors no issues you can try it out.

Puspharaj avatar Oct 24 '21 14:10 Puspharaj

but it is crashing the application when I am using imagesegmentation.

rafay-tariq avatar Oct 24 '21 17:10 rafay-tariq

Pull example and run in your local machine to see if it's crash or not.

Post your error log.

Puspharaj avatar Oct 25 '21 03:10 Puspharaj

when i run this project it works but when i run image segmentation on flutter version 2.5 version (above null safety) it crash the whole project and kill the app

A resource failed to call close. The Flutter DevTools debugger and profiler on sdk gphone arm64 is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:61030/_lmORiwaicE=/ E/libc ( 6668): Access denied finding property "ro.hardware.chipname" V/time ( 6668): Inference took 156 D/AndroidRuntime( 6668): Shutting down VM E/AndroidRuntime( 6668): FATAL EXCEPTION: main E/AndroidRuntime( 6668): Process: com.tfliteflutteryolokshitizninja.flutter_tflite, PID: 6668 E/AndroidRuntime( 6668): java.lang.IndexOutOfBoundsException: Index: 15, Size: 1 E/AndroidRuntime( 6668): at java.util.ArrayList.get(ArrayList.java:437) E/AndroidRuntime( 6668): at sq.flutter.tflite.TflitePlugin.fetchArgmax(TflitePlugin.java:1153) E/AndroidRuntime( 6668): at sq.flutter.tflite.TflitePlugin$RunSegmentationOnImage.onRunTfliteDone(TflitePlugin.java:1035) E/AndroidRuntime( 6668): at sq.flutter.tflite.TflitePlugin$TfliteTask.onPostExecute(TflitePlugin.java:477) E/AndroidRuntime( 6668): at sq.flutter.tflite.TflitePlugin$TfliteTask.onPostExecute(TflitePlugin.java:445) E/AndroidRuntime( 6668): at android.os.AsyncTask.finish(AsyncTask.java:771) E/AndroidRuntime( 6668): at android.os.AsyncTask.access$900(AsyncTask.java:199) E/AndroidRuntime( 6668): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788) E/AndroidRuntime( 6668): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime( 6668): at android.os.Looper.loop(Looper.java:223) E/AndroidRuntime( 6668): at android.app.ActivityThread.main(ActivityThread.java:7656) E/AndroidRuntime( 6668): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 6668): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/AndroidRuntime( 6668): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) I/Process ( 6668): Sending signal. PID: 6668 SIG: 9 Lost connection to device.

rafay-tariq avatar Oct 25 '21 07:10 rafay-tariq

Any updates ?

guccisekspir avatar Dec 06 '21 16:12 guccisekspir

any updates ?

nawzhin95 avatar Dec 06 '21 20:12 nawzhin95

https://github.com/shaqian/flutter_tflite/pull/230

zhengbomo avatar Dec 16 '21 13:12 zhengbomo

Using @zhengbomo solution by changing the podspec file: tflite: git: url: [email protected]:zhengbomo/flutter_tflite.git

  • Worked only on the android emulator for me

Omer-Rahmany avatar Dec 19 '21 22:12 Omer-Rahmany

Hello, you can use my repo

tflite_maven: git: url: https://github.com/NavidHosseini/tflite.git ref: master

Its is work fine for now

example : https://github.com/NavidHosseini/tflite/blob/master/example/example%20real%20time.rar

NavidHosseini avatar Jun 30 '22 08:06 NavidHosseini

nice

Puspharaj avatar Jul 02 '22 12:07 Puspharaj

@NavidHosseini Is there a guide on how to update the plugin? It says your tflite is not supported for v2

JohnKisisri avatar Sep 30 '22 15:09 JohnKisisri

tflite is working for flutter? still not?

Tiran-Jayasekara avatar Dec 17 '22 18:12 Tiran-Jayasekara