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

Can not run your project #4

Open
monta85 opened this issue Oct 24, 2023 · 4 comments
Open

Can not run your project #4

monta85 opened this issue Oct 24, 2023 · 4 comments

Comments

@monta85
Copy link

monta85 commented Oct 24, 2023

I've tried to run your project but I'm still making mistakes.
I'm on version Flutter 3.10
here is my console debug:
`
I/BLASTBufferQueue(27649): SurfaceView[com.example.flutterandroidautoos.flutter_android_auto_os_example/com.example.flutterandroidautoos.flutter_android_auto_os_example.MainActivity]@0#1 onFrameAvailable the first frame is available
D/SurfaceView@816ba58(27649): setAlpha: mUseAlpha = false alpha=1.0
D/SurfaceView@816ba58(27649): updateSurfaceAlpha: setUseAlpha() is not called, ignored.
E/flutter (27649): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method getPlatformVersion on channel flutter_android_auto_os)
E/flutter (27649): #0 MethodChannel._invokeMethod
platform_channel.dart:308
E/flutter (27649):
E/flutter (27649): #1 FlutterAndroidAutoOs.platformVersion
flutter_android_auto_os.dart:11
E/flutter (27649):
E/flutter (27649): #2 _HomePageState.initPlatformState
main.dart:56
E/flutter (27649):
════════ Exception caught by services library ══════════════════════════════════
The following MissingPluginException was thrown while activating platform stream on channel car_gear:
MissingPluginException(No implementation found for method listen on channel car_gear)

When the exception was thrown, this was the stack
#0 MethodChannel._invokeMethod

#1 EventChannel.receiveBroadcastStream.

════════════════════════════════════════════════════════════════════════════════
`

@SteMMo33
Copy link

SteMMo33 commented Jan 4, 2024

Hello,
I'm also trying to compile/run this project.
After a lot of tests to port the project to Flutter 3.16 - SDK 34 I obtained the same error.
Finally I added some Log.x("AUTO", ..) in the java side and I maybe found the problem looking in the Logcat window:

2024-01-04 10:15:24.059 17655-17655 AUTO                    com...utter_android_auto_os_example  V  [java][setupChannels]
2024-01-04 10:15:24.137 17655-17655 GeneratedP...nsRegister com...utter_android_auto_os_example  E  Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@472bb3b) but could not find or invoke the GeneratedPluginRegistrant.
2024-01-04 10:15:24.142 17655-17655 GeneratedP...nsRegister com...utter_android_auto_os_example  E  Received exception while registering
                                                                                                    java.lang.reflect.InvocationTargetException
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80)
                                                                                                    	at io.flutter.embedding.android.FlutterActivity.configureFlutterEngine(FlutterActivity.java:1277)
                                                                                                    	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:213)
                                                                                                    	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:634)
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os_example.MainActivity.onCreate(MainActivity.java:16)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8329)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8308)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1389)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3746)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3903)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:137)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2389)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8066)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
                                                                                                    Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/car/Car;
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os.FlutterAndroidAutoOsPlugin.setupChannels(FlutterAndroidAutoOsPlugin.java:77)
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os.FlutterAndroidAutoOsPlugin.onAttachedToActivity(FlutterAndroidAutoOsPlugin.java:119)
                                                                                                    	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add(FlutterEngineConnectionRegistry.java:156)
                                                                                                    	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:19)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80) 
                                                                                                    	at io.flutter.embedding.android.FlutterActivity.configureFlutterEngine(FlutterActivity.java:1277) 
                                                                                                    	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:213) 
                                                                                                    	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:634) 
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os_example.MainActivity.onCreate(MainActivity.java:16) 
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8329) 
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8308) 
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1389) 
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3746) 
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3903) 
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:137) 
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2389) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201) 
                                                                                                    	at android.os.Looper.loop(Looper.java:288) 
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8066) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703) 
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911) 
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.car.Car" on path: DexPathList[[zip file "/data/app/~~S3nVv0nEgLpldvJPqe23lg==/com.example.flutterandroidautoos.flutter_android_auto_os_example-7Py_D-3VOc_ykTd2VIe41g==/base.apk"],nativeLibraryDirectories=[/data/app/~~S3nVv0nEgLpldvJPqe23lg==/com.example.flutterandroidautoos.flutter_android_auto_os_example-7Py_D-3VOc_ykTd2VIe41g==/lib/arm64, /data/app/~~S3nVv0nEgLpldvJPqe23lg==/com.example.flutterandroidautoos.flutter_android_auto_os_example-7Py_D-3VOc_ykTd2VIe41g==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
                                                                                                    	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os.FlutterAndroidAutoOsPlugin.setupChannels(FlutterAndroidAutoOsPlugin.java:77) 
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os.FlutterAndroidAutoOsPlugin.onAttachedToActivity(FlutterAndroidAutoOsPlugin.java:119) 
                                                                                                    	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add(FlutterEngineConnectionRegistry.java:156) 
                                                                                                    	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:19) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80) 
                                                                                                    	at io.flutter.embedding.android.FlutterActivity.configureFlutterEngine(FlutterActivity.java:1277) 
                                                                                                    	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:213) 
                                                                                                    	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:634) 
                                                                                                    	at com.example.flutterandroidautoos.flutter_android_auto_os_example.MainActivity.onCreate(MainActivity.java:16) 
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8329) 
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8308) 
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1389) 
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3746) 
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3903) 
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:137) 
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2389) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201) 
                                                                                                    	at android.os.Looper.loop(Looper.java:288) 
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8066) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703) 
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911) 
2024-01-04 10:15:24.231 17655-17655 auto_os_example         com...utter_android_auto_os_example  W  Accessing hidden method 
...

So the main problem in my understanding is:

...
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/car/Car;
at com.example.flutterandroidautoos.flutter_android_auto_os.FlutterAndroidAutoOsPlugin.setupChannels(FlutterAndroidAutoOsPlugin.java:77)
at com.example.flutterandroidautoos.flutter_android_auto_os.FlutterAndroidAutoOsPlugin.onAttachedToActivity(FlutterAndroidAutoOsPlugin.java:119)
...

Where the Car class comes from?
Is there any additional library to install / insert in the project or in the mobile??

Hope this help ..

@SteMMo33
Copy link

SteMMo33 commented Jan 4, 2024

If I remove all the Car class references, the call to getPlatformVersion method returns the correct value without errors.

@SteMMo33
Copy link

SteMMo33 commented Jan 4, 2024

The app MUST run on the device on the car!
Only there class Car is present (or better in Android Auto OS)!

@mtiendat
Copy link

did you have integrate android auto existing project flutter?

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

3 participants