You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.
If you input a URL manually that lacks a study ID, the app will crash when it tries to deliver the toast describing the missing information in the URL. My understanding is that this crash is happening because a background thread is trying to directly trigger a toast, which should only be done by a UI thread.
Android 11 device
Procedure:
Install AWARE app, with no AWARE install preexisting
Approve permissions
Scroll to “AWARE study” section
Enter URL "https://my_website.com:8080" , press “OK”
Toast.makeText(Aware_Join_Study.this, "Missing API key or study ID. Scanned: " + study_url, Toast.LENGTH_SHORT).show();
2022-09-08 13:08:59.360 11549-11572/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.aware.phone, PID: 11549
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:415)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.NullPointerException: Can't toast on a thread that has not called Looper.prepare()
at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:157)
at android.widget.Toast.getLooper(Toast.java:179)
at android.widget.Toast.<init>(Toast.java:164)
at android.widget.Toast.makeText(Toast.java:497)
at android.widget.Toast.makeText(Toast.java:480)
at com.aware.phone.ui.Aware_Join_Study$PopulateStudy.doInBackground(Aware_Join_Study.java:385)
at com.aware.phone.ui.Aware_Join_Study$PopulateStudy.doInBackground(Aware_Join_Study.java:278)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
If you input a URL manually that lacks a study ID, the app will crash when it tries to deliver the toast describing the missing information in the URL. My understanding is that this crash is happening because a background thread is trying to directly trigger a toast, which should only be done by a UI thread.
Android 11 device
Procedure:
Relevant line:
aware-client/aware-phone/src/main/java/com/aware/phone/ui/Aware_Join_Study.java
Line 385 in 7d1f276
For possible fixes, see https://stackoverflow.com/questions/3875184/cant-create-handler-inside-thread-that-has-not-called-looper-prepare
The text was updated successfully, but these errors were encountered: