Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect crashing on Android 4.4 #3351

Closed
bognasoldev89 opened this issue Sep 18, 2019 · 1 comment · Fixed by #3362
Closed

Collect crashing on Android 4.4 #3351

bognasoldev89 opened this issue Sep 18, 2019 · 1 comment · Fixed by #3362
Assignees

Comments

@bognasoldev89
Copy link

Software and hardware versions

Collect v1.23.3, Android v4.4

Problem description

I was testing #3345 and I was not able to get blank form from Aggregate on Android 4.4. Collect was crashing after taping on button "Get Blank Form". I tried this on master and apk crashed too, at the same moment.

Steps to reproduce the problem

  1. Install master apk
  2. Set Aggregate on Server settings
  3. Tap "Get Blank Form" on the Main Menu

Expected behavior

List of available form should display, the app should not crash.

Other information

Here are logs from Android Studio from reproducing this issue:

09-18 14:49:09.131 9931-10094/org.odk.collect.android E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: org.odk.collect.android, PID: 9931
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:841)
Caused by: java.lang.ExceptionInInitializerError
at okhttp3.OkHttpClient.(OkHttpClient.kt:219)
at okhttp3.OkHttpClient$Builder.build(OkHttpClient.kt:955)
at org.odk.collect.android.http.okhttp.OkHttpOpenRosaServerClientFactory.create(OkHttpOpenRosaServerClientFactory.java:68)
at org.odk.collect.android.http.okhttp.OkHttpConnection.createClient(OkHttpConnection.java:254)
at org.odk.collect.android.http.okhttp.OkHttpConnection.executeGetRequest(OkHttpConnection.java:73)
at org.odk.collect.android.http.CollectServerClient.getHttpInputStream(CollectServerClient.java:103)
at org.odk.collect.android.http.CollectServerClient.getXmlDocument(CollectServerClient.java:51)
at org.odk.collect.android.utilities.DownloadFormListUtils.downloadFormList(DownloadFormListUtils.java:113)
at org.odk.collect.android.tasks.DownloadFormListTask.doInBackground(DownloadFormListTask.java:49)
at org.odk.collect.android.tasks.DownloadFormListTask.doInBackground(DownloadFormListTask.java:34)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
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:841) 
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
at okhttp3.internal.platform.AndroidPlatform$Companion.buildIfSupported(AndroidPlatform.kt:370)
at okhttp3.internal.platform.Platform$Companion.findPlatform(Platform.kt:204)
at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:178)
at okhttp3.internal.platform.Platform.(Platform.kt:179)
at okhttp3.OkHttpClient.(OkHttpClient.kt:219) 
at okhttp3.OkHttpClient$Builder.build(OkHttpClient.kt:955) 
at org.odk.collect.android.http.okhttp.OkHttpOpenRosaServerClientFactory.create(OkHttpOpenRosaServerClientFactory.java:68) 
at org.odk.collect.android.http.okhttp.OkHttpConnection.createClient(OkHttpConnection.java:254) 
at org.odk.collect.android.http.okhttp.OkHttpConnection.executeGetRequest(OkHttpConnection.java:73) 
at org.odk.collect.android.http.CollectServerClient.getHttpInputStream(CollectServerClient.java:103) 
at org.odk.collect.android.http.CollectServerClient.getXmlDocument(CollectServerClient.java:51) 
at org.odk.collect.android.utilities.DownloadFormListUtils.downloadFormList(DownloadFormListUtils.java:113) 
at org.odk.collect.android.tasks.DownloadFormListTask.doInBackground(DownloadFormListTask.java:49) 
at org.odk.collect.android.tasks.DownloadFormListTask.doInBackground(DownloadFormListTask.java:34) 
at android.os.AsyncTask$2.call(AsyncTask.java:288) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
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:841) 

09-18 14:49:09.942 9931-9931/org.odk.collect.android E/OpenGLRenderer: SFEffectCache:clear(), mSize = 0
09-18 14:49:09.952 9931-9931/org.odk.collect.android E/WindowManager: android.view.WindowLeaked: Activity org.odk.collect.android.activities.FormDownloadList has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{42375b68 V.E..... R.....ID 0,0-480,316} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:388)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:286)
at org.odk.collect.android.utilities.DialogUtils.showDialog(DialogUtils.java:81)
at org.odk.collect.android.activities.FormDownloadList.createProgressDialog(FormDownloadList.java:712)
at org.odk.collect.android.activities.FormDownloadList.downloadFormList(FormDownloadList.java:316)
at org.odk.collect.android.activities.FormDownloadList.init(FormDownloadList.java:267)
at org.odk.collect.android.activities.FormDownloadList.access$000(FormDownloadList.java:90)
at org.odk.collect.android.activities.FormDownloadList$1.granted(FormDownloadList.java:151)
at org.odk.collect.android.utilities.PermissionUtils$1.granted(PermissionUtils.java:133)
at org.odk.collect.android.utilities.PermissionUtils$11.onPermissionsChecked(PermissionUtils.java:310)
at com.karumi.dexter.DexterInstance$1.run(Unknown Source)
at com.karumi.dexter.MainThread.execute(Unknown Source)
at com.karumi.dexter.DexterInstance.checkMultiplePermissions(Unknown Source)
at com.karumi.dexter.DexterInstance.checkPermissions(Unknown Source)
at com.karumi.dexter.Dexter.check(Unknown Source)
at org.odk.collect.android.utilities.PermissionUtils.requestPermissions(PermissionUtils.java:278)
at org.odk.collect.android.utilities.PermissionUtils.requestStoragePermissions(PermissionUtils.java:130)
at org.odk.collect.android.activities.FormDownloadList.onCreate(FormDownloadList.java:140)
at android.app.Activity.performCreate(Activity.java:5442)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$800(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)

@kkrawczyk123
Copy link
Contributor

I have noticed a crash when open General Settings/Server on Android 4.4 and the cause might be the same
logs:
09-20 13:41:43.952 12239-12239/org.odk.collect.android E/AndroidRuntime: FATAL EXCEPTION: main Process: org.odk.collect.android, PID: 12239 java.lang.ExceptionInInitializerError at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:219) at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:211) at org.odk.collect.android.injection.config.AppDependencyModule.provideHttpInterface(AppDependencyModule.java:78) at org.odk.collect.android.injection.config.AppDependencyModule_ProvideHttpInterfaceFactory.provideHttpInterface(AppDependencyModule_ProvideHttpInterfaceFactory.java:37) at org.odk.collect.android.injection.config.AppDependencyModule_ProvideHttpInterfaceFactory.get(AppDependencyModule_ProvideHttpInterfaceFactory.java:27) at org.odk.collect.android.injection.config.AppDependencyModule_ProvideHttpInterfaceFactory.get(AppDependencyModule_ProvideHttpInterfaceFactory.java:10) at dagger.internal.DoubleCheck.get(DoubleCheck.java:47) at org.odk.collect.android.injection.config.DaggerAppDependencyComponent.getCollectServerClient(DaggerAppDependencyComponent.java:93) at org.odk.collect.android.injection.config.DaggerAppDependencyComponent.injectServerPreferencesFragment(DaggerAppDependencyComponent.java:267) at org.odk.collect.android.injection.config.DaggerAppDependencyComponent.inject(DaggerAppDependencyComponent.java:154) at org.odk.collect.android.preferences.ServerPreferencesFragment.onAttach(ServerPreferencesFragment.java:107) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:850) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1063) at android.app.BackStackRecord.run(BackStackRecord.java:684) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1450) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:444) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5164) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19 at okhttp3.internal.platform.AndroidPlatform$Companion.buildIfSupported(AndroidPlatform.kt:370) at okhttp3.internal.platform.Platform$Companion.findPlatform(Platform.kt:204) at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:178) at okhttp3.internal.platform.Platform.<clinit>(Platform.kt:179) at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:219)  at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:211)  at org.odk.collect.android.injection.config.AppDependencyModule.provideHttpInterface(AppDependencyModule.java:78)  at org.odk.collect.android.injection.config.AppDependencyModule_ProvideHttpInterfaceFactory.provideHttpInterface(AppDependencyModule_ProvideHttpInterfaceFactory.java:37)  at org.odk.collect.android.injection.config.AppDependencyModule_ProvideHttpInterfaceFactory.get(AppDependencyModule_ProvideHttpInterfaceFactory.java:27)  at org.odk.collect.android.injection.config.AppDependencyModule_ProvideHttpInterfaceFactory.get(AppDependencyModule_ProvideHttpInterfaceFactory.java:10)  at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)  at org.odk.collect.android.injection.config.DaggerAppDependencyComponent.getCollectServerClient(DaggerAppDependencyComponent.java:93)  at org.odk.collect.android.injection.config.DaggerAppDependencyComponent.injectServerPreferencesFragment(DaggerAppDependencyComponent.java:267)  at org.odk.collect.android.injection.config.DaggerAppDependencyComponent.inject(DaggerAppDependencyComponent.java:154)  at org.odk.collect.android.preferences.ServerPreferencesFragment.onAttach(ServerPreferencesFragment.java:107)  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:850)  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1063)  at android.app.BackStackRecord.run(BackStackRecord.java:684)  at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1450)  at android.app.FragmentManagerImpl$1.run(FragmentManager.java:444)  at android.os.Handler.handleCallback(Handler.java:733)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5164)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)  at dalvik.system.NativeStart.main(Native Method)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants