androidthings / sample-googleassistant

Google Assistant API sample for Android Things
Apache License 2.0
467 stars 147 forks source link

if apk(this source) install on the Mobile phone(Emulator), is it available? #65

Closed asjgi closed 6 years ago

asjgi commented 6 years ago

if apk(this source) install on the Mobile phone(Emulator), is it available?

Before when I build this source, I have a problem with this link. (https://github.com/androidthings/sample-googleassistant/issues/38) And then I fixed it.

A lot of time to try open again, but this application is not a operated at the emulator. and both of mobile phone(Oreo) but I can`t use anything which I want. when I try to open, I can see this log.

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.androidthings.assistant, PID: 3549 java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/things/pio/PeripheralManager; at com.example.androidthings.assistant.AssistantActivity.onCreate(AssistantActivity.java:126) at android.app.Activity.performCreate(Activity.java:7009) at android.app.Activity.performCreate(Activity.java:7000) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.things.pio.PeripheralManager" on path: DexPathList[[zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/base.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.androidthings.assistant-meprfKZXTXvjk5Mb2Xe0RQ==/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.example.androidthings.assistant.AssistantActivity.onCreate(AssistantActivity.java:126)  at android.app.Activity.performCreate(Activity.java:7009)  at android.app.Activity.performCreate(Activity.java:7000)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)  Application terminated.

How can I solve this problem ? Somebody help me ~

Fleker commented 6 years ago

You will need to clean up the AssistantActivity class to remove references specifically around Android Things. There's a few classes like Gpio and Button that do not exist on phones.

asjgi commented 6 years ago

@Fleker Thank you for giving me a comment. And I`m gonna try to change to Android mobile source from the dependency of "Android things source".