androidthings / sample-googleassistant

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

build failed #87

Closed YinXiuYu closed 5 years ago

YinXiuYu commented 5 years ago

org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details

Fleker commented 5 years ago

You need to provide more information about your setup and the compiler error output

YinXiuYu commented 5 years ago

Thank you very much for taking the time to answer my questions. Duo to the demo project hasn't raw folder included the credentials.json file, I encountered errors while generating the file. when I used the google-oauthlib-tool to generate my credentials, outputd error occurs as follows: raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='accounts.google.c om', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by NewCon nectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x032B27F0>: Failed to establish a new connection: [WinError 10060]

YinXiuYu commented 5 years ago

By the way,I want to integrate the google assistant into my app on android phone using this project to set up a demo to see some effects. I am very looking forward for your reply. Mr Fleker , thank you very much again.

Fleker commented 5 years ago

Yes, the project will not compile at first, as you'll need to generate those credentials.

A cursory search for WinError 10060, preventing you from generating that file, seems to suggest perhaps a proxy issue preventing you from connecting to the URL.

YinXiuYu commented 5 years ago

Thank you very much for answering the question, I have solved it. It has been successfully compiled and passed, and there is still a problem to ask you how can i use this project as an APP on my android phone, what codes do I need to remove?Looking forward to your reply! Mr Fleker , thank you very much again.

Fleker commented 5 years ago

You should remove the Android Things support library from app/build.gradle, and remove any references to Android Things or the PeripheralManager in the main activity and EmbeddedAssistant files.

YinXiuYu commented 5 years ago

Hi,Fleker Follow your advice,I have removed any references to Android Things, I have seen the UI of the APP. But my phone cann't recognize my voice when I clicked the "NEW REQUEST" button, what I need to make some changes in that part of the codes,can you tell me more about the source code. Thanks a lot in advance!

Fleker commented 5 years ago

I don't know. Do you have any logs relating to something failing or crashing? Did you enable all of the permissions?

saberuaf commented 5 years ago

I am facing following exception while posting audio input. Please help.

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) at io.grpc.okhttp.OkHttpProtocolNegotiator.negotiate(OkHttpProtocolNegotiator.java:93) at io.grpc.okhttp.OkHttpTlsUpgrader.upgrade(OkHttpTlsUpgrader.java:63) at io.grpc.okhttp.OkHttpClientTransport$1.run(OkHttpClientTransport.java:429) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.EOFException: SSL peer shut down incorrectly at sun.security.ssl.InputRecord.read(InputRecord.java:505) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ... 10 more

YinXiuYu commented 5 years ago

Hi,Fleker I already know about the audio configuration ,the source code as flow: audioInputDevice = findAudioDevice(AudioManager.GET_DEVICES_INPUTS,AudioDeviceInfo.TYPE_BUS); But i want to know how to use the audioInput with my android phone, can you tell more details? Thanks a lot in advance!

Fleker commented 5 years ago

If you're seeing an SSL error, there's a problem with your Internet/SSL connection.

If you want to use the default audio I/O, you can leave the AudioDeviceInfo objects null and the default busses will be used.

YinXiuYu commented 5 years ago

Hi,Fleker I'm sorry to ask you questions again, thanks a lot in advance ! I have seted the AudioDeviceInfo objects null, but it doesn't work ,I found out it was listening all the time by debugging the codes.

YinXiuYu commented 5 years ago

some error logs as flow: io.grpc.StatusRuntimeException: UNAVAILABLE: Service unavailable. at io.grpc.Status.asRuntimeException(Status.java:526) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:419)

YinXiuYu commented 5 years ago

I can get the response by the method of "mEmbeddedAssistant.startConversation("What's the weather like today?");" , but it doesn't work with the method of "mEmbeddedAssistant.startConversation();"

YinXiuYu commented 5 years ago

I thought I could not recognize my voice command, I checked Google API service and the command s had been received , but errors image

Fleker commented 5 years ago

If you're seeing errors with your audio data, you may want to confirm you can record audio info. Is your audio recording permission disabled?

YinXiuYu commented 5 years ago

Hi, Fleker, I've come back to ask you questions,I have successfully run the demo on my android phone, I want to ask you if I can just say a voice command request of "take a picture" in the demo and then Assistant service will turn on my camera like the Google Assistant on my phone.

Fleker commented 5 years ago

That would be implemented as a custom device action.

Swathi2610 commented 5 years ago

I used this androidthings google assistant demo just as an android app and push to talk function is working properly. Do you know how I can add okay google wake word function to this app. Kindly reply. I also want to know whether google assistant SDK support multiple microphones( 4 to 6). Thank you

Fleker commented 5 years ago

There's no trivial way to add wake words as this sample uses a server-side only API. You'd need to find another library that runs this locally.

You can't support multiple microphones unless you mix them all down before sending the audio data.

Swathi2610 commented 5 years ago

Thank you for your reply. So there is no way to add wake word. Is there another api that I can use to add wakeword.

Fleker commented 5 years ago

I'm not aware of any off-hand. A quick search came up with Porcupine, although I've never tried it out myself.

Swathi2610 commented 5 years ago

Thank you for the reply. But do you any idea about which part of this sample should I add under the wake word detection block or should I use a separate activity as wake word detection and call the embedded assistant activity in that. I am trying all this methods but the app is crashing while opening.

Fleker commented 5 years ago

You may see where we handle the button press event, which then starts an Assist gRPC event with the Assistant. You should be able to start a listener in the onCreate event that starts to listen.

Swathi2610 commented 5 years ago

Hi, Thank you for your assistance. I tried adding mEmbeddedAssistant.startConversation() part under the hotword detection part but I am not getting any reply from the assistant. So how do I call the assistant. Can you give me little assistance regarding this. Thank you again

Fleker commented 5 years ago

startConversation is when it starts to listen. Once you see the hotword is detected, then you should see the conversation start and see the gRPC calls being made to send up audio. Then you should see the results streaming back.

YinXiuYu commented 5 years ago

Hi,Fleker I can't get the correct session from the Actions on Google I had been set, I had set the Model_ID that I got from device registration.Do I have to set DEVICE_INSTANCE_ID and how do I get it?

Fleker commented 5 years ago

I don't fully understand your question. Assistant SDK does not directly work with Actions on Google, so you won't directly get values from one to another.

Swathi2610 commented 5 years ago

Hi, I installed google assistant app in android, the google assistant is not responding properly. Sometimes it answers my question but if I close the app and immediately open it and then press the button and ask a question it will not respond. But if I close the app and open it again after sometimes it responds. Why does this irregularity occur. Do you know what might be causing this kind of an error. Kindly reply. Thank you

Fleker commented 5 years ago

You should check application logs. It seems like there may be an issue with the connection cutting out, which needs to be re-created.