Code Monkey home page Code Monkey logo

Comments (19)

johnpeterflynn avatar johnpeterflynn commented on July 20, 2024

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.

Aashit-Sharma avatar Aashit-Sharma commented on July 20, 2024

Same issue. wondering if someone knows the fix...

from dialogflow-android-client.

vishalkharat avatar vishalkharat commented on July 20, 2024

@johnflynn90 Same issue we are facing. Can you please share fix?

from dialogflow-android-client.

tao1 avatar tao1 commented on July 20, 2024

Same here

from dialogflow-android-client.

johnpeterflynn avatar johnpeterflynn commented on July 20, 2024

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.

vishalkharat avatar vishalkharat commented on July 20, 2024

@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.

Aashit-Sharma avatar Aashit-Sharma commented on July 20, 2024

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.

folomeev avatar folomeev commented on July 20, 2024

Hello friends!

Please no worries, we are working on problem!

Thank you for your patience

from dialogflow-android-client.

folomeev avatar folomeev commented on July 20, 2024

The issue was fixed in Java SDK and will be available on next release.

from dialogflow-android-client.

SidCosineLabs avatar SidCosineLabs commented on July 20, 2024

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.

folomeev avatar folomeev commented on July 20, 2024

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.

SidCosineLabs avatar SidCosineLabs commented on July 20, 2024

from dialogflow-android-client.

folomeev avatar folomeev commented on July 20, 2024

I've build apiAISampleApp application and everything was fine.
Would you be so kind to provide the call stack traces?

from dialogflow-android-client.

SidCosineLabs avatar SidCosineLabs commented on July 20, 2024

from dialogflow-android-client.

HoiJean avatar HoiJean commented on July 20, 2024

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.

tao1 avatar tao1 commented on July 20, 2024

This error came back about 2 or 3 days. But this bug had disappeared for about 2 weeks before that.

from dialogflow-android-client.

folomeev avatar folomeev commented on July 20, 2024

Fixed.
Please update dependency version up to 2.0.6:

compile 'ai.api:sdk:2.0.6@aar'

from dialogflow-android-client.

SidCosineLabs avatar SidCosineLabs commented on July 20, 2024

from dialogflow-android-client.

Rabbi50 avatar Rabbi50 commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.