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

Could not initialize SDK from background thread #15

Closed
gotev opened this issue Oct 10, 2018 · 1 comment
Closed

Could not initialize SDK from background thread #15

gotev opened this issue Oct 10, 2018 · 1 comment

Comments

@gotev
Copy link

gotev commented Oct 10, 2018

Hi, using AdForm 1.2.0 on Android 8, in an attempt to reduce initial app loading time, I moved the following statements:

AdformTrackingSdk.startTracking(context, trackingID)
AdformTrackingSdk.setHttpsEnabled(true)

into an IntentService, but then my app crashes and I get the following stack trace

    java.lang.IllegalStateException: Calling View methods on another thread than the UI thread.
        at com.android.webview.chromium.WebViewChromium.b(PG:115)
        at com.android.webview.chromium.WebViewChromium.c(PG:117)
        at com.android.webview.chromium.WebViewChromium.init(PG:45)
        at android.webkit.WebView.<init>(WebView.java:651)
        at android.webkit.WebView.<init>(WebView.java:581)
        at android.webkit.WebView.<init>(WebView.java:564)
        at android.webkit.WebView.<init>(WebView.java:551)
        at android.webkit.WebView.<init>(WebView.java:541)
        at com.adform.adformtrackingsdk.web.AdWebView.<init>(AdWebView.java:36)
        at com.adform.adformtrackingsdk.web.NetworkLoader.<init>(NetworkLoader.java:50)
        at com.adform.adformtrackingsdk.services.SendService.<init>(SendService.java:35)
        at com.adform.adformtrackingsdk.MainHandler.onStart(MainHandler.java:106)
        at com.adform.adformtrackingsdk.general.AbstractHandler.startTracking(AbstractHandler.java:69)
        at com.adform.adformtrackingsdk.AdformTrackingSdk.startTracking(AdformTrackingSdk.java:57)
        at com.adform.adformtrackingsdk.AdformTrackingSdk.startTracking(AdformTrackingSdk.java:38)

because it seems AdForm SDK does something with WebView, which could not be initialized from a background thread. Other tracking solutions are used in the same app, but they all play nice being initialized from a background thread. Is there a way to make AdForm initializable from a background thread, too?

Thank you 😉

@gotev
Copy link
Author

gotev commented Oct 11, 2018

Moved to adform/adform-tracking-android-sdk#7

@gotev gotev closed this as completed Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant