Comments (19)
My team encountered the exact same crash as of yesterday.
This problem appears to occur on Android when an agent uses an intent with a default text response (no webhook). We fixed it by using a webhook to fulfill all of our intents.
from dialogflow-android-client.
Same issue. wondering if someone knows the fix...
from dialogflow-android-client.
@johnflynn90 Same issue we are facing. Can you please share fix?
from dialogflow-android-client.
Same here
from dialogflow-android-client.
Hi @vishalkharat ,
We didn't really fix it. We avoided the crash by only using webhooks to generate responses to intents.
When creating an intent in API.AI you have the option to check "use webhook" instead of using text responses. My team found that the crash only occurs when we used the local API.AI text responses. We modified all of our intents to use webhooks so that our fulfillment server would generate text responses. I don't know why this works; we discovered it through trial and error.
If you don't have a fulfillment server (e.g. your agent lives entirely in API.AI) then this solution won't work for you.
from dialogflow-android-client.
@johnflynn90 Thanks for reply.
I think this can be fixed by updating libai sdk. As api.ai is sending messages object in two formats as part of response. Because of this android app fails to map these objects, and results in a crash.
Following is the sample response.
"messages":[
{
"type":"simple_response",
"platform":"google",
"textToSpeech":"sample text to convert"
},
{
"type":0,
"speech":"sample text to convert"
}
]
from dialogflow-android-client.
Updating libai sdk how ? I am using the latest 1.4.8 in my build gradle , still this issue.
I think the issue lies in the onResult method
I may be wrong though
from dialogflow-android-client.
Hello friends!
Please no worries, we are working on problem!
Thank you for your patience
from dialogflow-android-client.
The issue was fixed in Java SDK and will be available on next release.
from dialogflow-android-client.
When is the next release coming for android because I am now frequently getting this issue in my android app. And if you can tell me any workaround please let me know.
Thanks
from dialogflow-android-client.
There is a kind of workaround. You may manually build and install Java SDK from GitHub repository:
git clone https://github.com/api-ai/apiai-java-client.git
cd apiai-java-client/
mvn install
This commands will checkout the code, build it and install library of version 1.4.9 into your local maven repository.
Next step is to change dependency version in your build.gradle
file:
find line
compile 'ai.api:libai:1.4.8'
and replace it with
compile 'ai.api:libai:1.4.9'
rebuild your project.
from dialogflow-android-client.
from dialogflow-android-client.
I've build apiAISampleApp application and everything was fine.
Would you be so kind to provide the call stack traces?
from dialogflow-android-client.
from dialogflow-android-client.
Hello everyone, i am still facing the same issue "Caused by: java.lang.NumberFormatException: Invalid int: "simple_response" " Before result the app crashes and i get that error on the console, see below the full error output:
AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: nl.nanomedia.virtuala, PID: 27568 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NumberFormatException: Invalid int: "simple_response" at java.lang.Integer.invalidInt(Integer.java:138) at java.lang.Integer.parse(Integer.java:410) at java.lang.Integer.parseInt(Integer.java:367) at java.lang.Integer.parseInt(Integer.java:334) at com.google.gson.JsonPrimitive.getAsInt(JsonPrimitive.java:260) at ai.api.GsonFactory$ResponseItemAdapter.deserialize(GsonFactory.java:78) at ai.api.GsonFactory$ResponseItemAdapter.deserialize(GsonFactory.java:71) at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.Gson.fromJson(Gson.java:887) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at com.google.gson.Gson.fromJson(Gson.java:773) at ai.api.AIDataService.request(AIDataService.java:193) at ai.api.AIDataService.request(AIDataService.java:148) at ai.api.services.GoogleRecognitionServiceImpl$2.doInBackground(GoogleRecognitionServiceImpl.java:166) at ai.api.services.GoogleRecognitionServiceImpl$2.doInBackground(GoogleRecognitionServiceImpl.java:158) at android.os.AsyncTask$2.call(AsyncTask.java:288)
from dialogflow-android-client.
This error came back about 2 or 3 days. But this bug had disappeared for about 2 weeks before that.
from dialogflow-android-client.
Fixed.
Please update dependency version up to 2.0.6:
compile 'ai.api:sdk:2.0.6@aar'
from dialogflow-android-client.
from dialogflow-android-client.
Hello everyone, i facing error " Caused by: java.lang.NumberFormatException:For input string: "Rabbi"".
Before the app crashes i get the following error:
2018-03-31 20:42:53.448 32009-32066/com.example.diu.pointofsale E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
Process: com.example.diu.pointofsale, PID: 32009
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:318)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.NumberFormatException: For input string: "Rabbi"
at java.lang.Integer.parseInt(Integer.java:521)
at java.lang.Integer.parseInt(Integer.java:556)
at com.example.diu.pointofsale.Database.DatabaseHelper.getAllUser(DatabaseHelper.java:267)
at com.example.diu.pointofsale.Activity.AdminHomeActivity$2.doInBackground(AdminHomeActivity.java:108)
at com.example.diu.pointofsale.Activity.AdminHomeActivity$2.doInBackground(AdminHomeActivity.java:104)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Please help me how to fix it..
from dialogflow-android-client.
Related Issues (20)
- sending payload from V1 SDK HOT 1
- AIButton fails to initialize after following instructions in Integration.md
- TTS HOT 3
- end_conversation
- On account of using Hindi in DialogFlow
- voice rocoginition took same text in multiple time
- Quick Reply
- Hii Any client for v2 for android HOT 1
- HttpClient cannot be used in the same project with dialogflow HOT 1
- Mic button is not working in android with web demo integration HOT 1
- How to migrate to Dialogflow API V2 and the v2 client library for android client? HOT 11
- Can not getting card or images?
- How to send recorded audio in AIService or get record audio through AIListener of dialogflow android
- URLs to be allowed when using dialogflow-android in restricted network. . . HOT 1
- Raw JSON is there in the console but not getting response in the console nor device
- Language support
- AIService Error
- Intent fulfillments HOT 2
- Authorization failed. Please check your access keys. Error Issues
- Hindi not supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialogflow-android-client.