Thread
#compose
    p

    Philip Blandford

    2 years ago
    Having trouble building code that incudes a WebClient, using alpha01 and Canary 8: • com.android.tools.r8.errors.b: Space characters in SimpleName 'Boolean$fun-shouldOverrideUrlLoading$class-$no name provided$$val-client$fun-$anonymous$$arg-1$call-MyApplicationTheme$fun-$anonymous$$arg-1$call-setContent$fun-onCreate$class-MainActivity' are not allowed prior to DEX version 040 
    val client = object : WebViewClient() {
        override fun shouldOverrideUrlLoading(
          view: WebView,
          request: WebResourceRequest
        ): Boolean {
            view.loadUrl(request.url.toString())
            return true
        }
    }
    satyan

    satyan

    2 years ago
    I don’t think it’s related to compose. I saw a similar commit fixing it in Jetnews:https://github.com/android/compose-samples/commit/dc9b832bc9830ed92af52627f44e75311cc3c175
    Try to create a custom WebviewClient class instead of using
    object : WebViewClient
    p

    Philip Blandford

    2 years ago
    Ah thanks, that's worked around it.
    satyan

    satyan

    2 years ago
    Or maybe it’s linked to compose kotlin compiler extension. I couldn’t find the issue mentioned by @cb in the commit. Might be an internel bugtracker 🤷
    Timo Drick

    Timo Drick

    2 years ago
    The problem is the anonymous class. use
    'com.android.tools.build:gradle:4.2.0-alpha07
    or use named classes only or wait until the bug is fixed