Closed Jonathanwam closed 5 years ago
Sorry for the delay, let me take a look at this today - I had trouble getting hold of an android device
What version of android are you publishing to?
Sorry for the delay, I needed to set up my Unity Android environment. I have the ExampleStreaming
scene working in Android with no issues. This also uses IAM authentication. Can you try this scene and see if it works for you?
I also tried the AssistantV2 example in ServiceExamples
scene with no issues. Are you using Android prior to 5.0? It looks like TLS 1.2 is not supported in android below 5
My Android version is 7.0. I tested the ServiceExamples scene on both ExampleAssistantV2 and ExampleSpeechToText. They work fine when running in Unity but I get the same loop problem after building and running on Android.
I'll update my phone to the latest version to see if that helps.
Hmm I will try to update my device tomorrow as well. I was testing on Android 5
I updated to Android 7.1.1 on my Samsung Galaxy Tab A. I can still connect to Watson Services. Are you still having issues getting IAM token?
@Jonathanwam Any update on this issue?
Yes, same problem. I thought it could be my device but I just tested on an Android emulator and had the same issue. I'll try reinstalling Unity and the Watson SDK on my other laptop and see if that helps.
Interesting -- I'm having the sample problem on my Magic Leap 1
Any steps to reproduce? I haven’t been able to reproduce on Android. Does it happen only on magic leap device or on the simulator?
@Jonathanwam @bhylak We have not been able to reproduce the issue, can you please provide the info @mediumTaj requested?
This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi there, I am experiencing this same issue when building to Android. This is when trying to create an Assistant session, I get stuck in an infinite loop of "No Assistant Session created" (see below code, (while (!sessionCreated))). I am using Unity 2019.2.7f2 for Mac building to Android 8.0.0 on a Motorola G6. When I run in the editor on Mac it works perfectly but cannot get around this issue when building to Android.
if (string.IsNullOrEmpty(assistantIamApikey)) { throw new IBMException("Plesae provide IAM ApiKey for the Assistant service."); }
IamAuthenticator assistantAuthenticator = new IamAuthenticator(apikey: assistantIamApikey);
while (!assistantAuthenticator.CanAuthenticate()) {
Debug.Log("Not yet authenticated Assitant");
yield return null; }
_assistant = new AssistantService("2019-02-08", assistantAuthenticator);
if (!string.IsNullOrEmpty(AssistantURL))
{
_assistant.SetServiceUrl(AssistantURL);
}
_assistant.CreateSession(OnCreateSession, assistantId);
Debug.Log("Created Assistant Instance");
while (!sessionCreated) {
yield return null;
Debug.Log("No Assistant Instance Created"); // Here stuck in infinite loop
}
I created a simple app to test IBM Watson's Speech To Text. My plan is to deploy an Android app using it. My app works when playing on Unity, but does not work after building and running on my Android device.
Through exploring Logcat on Android Studio, I found that it was hitting an infinite loop in the while loop mentioned in the title. My credentials part of my code is below as well.
Again, it works on my PC within Unity. Does not work after building and deploying on Android.
Also, it works fine when I build it on Windows. So I think it's an Android specific issue.