hotwired / turbo-android

Android framework for making Turbo native apps
MIT License
407 stars 51 forks source link

TurboConfig.setDebugLoggingEnabled throws ExceptionInInitializerError #300

Closed graial closed 5 months ago

graial commented 5 months ago

Main Issue

I tried to enable debug on turbo as per here: turbo-android docs/ADVANCED-OPTIONS

and here: MainActivity.kt in demo app in the second case, Strada and WebView debugs were set without complaint, only Turbo crashes

I'm guessing it has something to do with the TurboHttpClient.reset() in TurboConfig.kt. maybe it's not initialized or something? I didn't notice anything about initiailizing turbo in the QUICK-START guide

This happens with both version 7.0.1 and 7.0.2 (with adjustments for targetSDK and minSDK).

not sure is this is related. It's how I found my way to this issue

I had previously been able to get the web-bridge working to add a button on the demo app.

Now I'm having this issue when trying to setup strada for my existing rails app.

So far, I haven't been successful in passing in a message that the bridge wouldn't ignore with the following:

bridgeDidIgnoreMessage ............ [Message(id=hi, component=hello, event=display, metadata=null, jsonData={})]

window.nativeBridge.supportedComponents returns my hello component

This is what I believe sends a message through the JavascriptInterface, but I can't figure out how to send metadata that it doesn't interpret as null window.nativeBridge.postMessage("{\"event\":\"display\", \"id\": \"hi\", \"component\": \"hello\", \"metadata\": {}}")

At any rate, that is a separate issue. I'm just not sure if Turbo is initialized correctly right now

graial commented 5 months ago

This ended up being some kind of build system junk. Even Android studio's build clean didn't resolve it the first time around.