Decompile .class file ,bytecode version :52.0 (java 8)

86 Views Asked by At

I encountered an issue while learning Jetpack Compose, which resulted in my Compose class appearing as shown in the image. Despite my efforts, I haven't been able to resolve this issue, and I suspect it may be related to the decompilation process of Java 8.

.class file instead of jet-pack compose class

// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available

package androidx.compose.material3

private val FabSpacing: androidx.compose.ui.unit.Dp /* compiled code */

internal val LocalFabPlacement: androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.material3.FabPlacement?> /* compiled code */

@androidx.compose.material3.ExperimentalMaterial3Api public var ScaffoldSubcomposeInMeasureFix: kotlin.Boolean /* compiled code */
    public final @androidx.compose.material3.ExperimentalMaterial3Api get
    public final @androidx.compose.material3.ExperimentalMaterial3Api set(value: kotlin.Boolean) {/* compiled code */ }

@androidx.compose.runtime.Composable @androidx.compose.runtime.ComposableInferredTarget private fun LegacyScaffoldLayout(fabPosition: androidx.compose.material3.FabPosition, topBar: @androidx.compose.runtime.Composable () -> kotlin.Unit, content: @androidx.compose.runtime.Composable (androidx.compose.foundation.layout.PaddingValues) -> kotlin.Unit, snackbar: @androidx.compose.runtime.Composable () -> kotlin.Unit, fab: @androidx.compose.runtime.Composable () -> kotlin.Unit, contentWindowInsets: androidx.compose.foundation.layout.WindowInsets, bottomBar: @androidx.compose.runtime.Composable () -> kotlin.Unit): kotlin.Unit { /* compiled code */ }

@androidx.compose.runtime.Composable @androidx.compose.runtime.ComposableInferredTarget public fun Scaffold(modifier: androidx.compose.ui.Modifier = COMPILED_CODE, topBar: @androidx.compose.runtime.Composable () -> kotlin.Unit = COMPILED_CODE, bottomBar: @androidx.compose.runtime.Composable () -> kotlin.Unit = COMPILED_CODE, snackbarHost: @androidx.compose.runtime.Composable () -> kotlin.Unit = COMPILED_CODE, floatingActionButton: @androidx.compose.runtime.Composable () -> kotlin.Unit = COMPILED_CODE, floatingActionButtonPosition: androidx.compose.material3.FabPosition = COMPILED_CODE, containerColor: androidx.compose.ui.graphics.Color = COMPILED_CODE, contentColor: androidx.compose.ui.graphics.Color = COMPILED_CODE, contentWindowInsets: androidx.compose.foundation.layout.WindowInsets = COMPILED_CODE, content: @androidx.compose.runtime.Composable (androidx.compose.foundation.layout.PaddingValues) -> kotlin.Unit): kotlin.Unit { /* compiled code */ }

@androidx.compose.runtime.Composable @androidx.compose.runtime.ComposableInferredTarget private fun ScaffoldLayout(fabPosition: androidx.compose.material3.FabPosition, topBar: @androidx.compose.runtime.Composable () -> kotlin.Unit, content: @androidx.compose.runtime.Composable (androidx.compose.foundation.layout.PaddingValues) -> kotlin.Unit, snackbar: @androidx.compose.runtime.Composable () -> kotlin.Unit, fab: @androidx.compose.runtime.Composable () -> kotlin.Unit, contentWindowInsets: androidx.compose.foundation.layout.WindowInsets, bottomBar: @androidx.compose.runtime.Composable () -> kotlin.Unit): kotlin.Unit { /* compiled code */ }

@androidx.compose.runtime.Composable @androidx.compose.runtime.ComposableInferredTarget private fun ScaffoldLayoutWithMeasureFix(fabPosition: androidx.compose.material3.FabPosition, topBar: @androidx.compose.runtime.Composable () -> kotlin.Unit, content: @androidx.compose.runtime.Composable (androidx.compose.foundation.layout.PaddingValues) -> kotlin.Unit, snackbar: @androidx.compose.runtime.Composable () -> kotlin.Unit, fab: @androidx.compose.runtime.Composable () -> kotlin.Unit, contentWindowInsets: androidx.compose.foundation.layout.WindowInsets, bottomBar: @androidx.compose.runtime.Composable () -> kotlin.Unit): kotlin.Unit { /* compiled code */ }

I attempted to download the source of the decompiled file and installed the Kotlin to Java decompile plug-in, but unfortunately, these actions did not help me solve the problem . Can anyone provide guidance on how to address this issue effectively?

when i press on Donwload resources , i got this wrong

FAILURE: Build failed with an exception.

* Where:
Initialization script 'C:\Users\ad011\AppData\Local\Temp\ijmiscinit1.gradle' line: 25

* What went wrong:
Execution failed for task ':app:DownloadSources'.
> Could not resolve all files for configuration ':app:downloadSources_01e59d2f-b2e1-4cb4-af0e-21e0cab1c0b2'.
   > Could not find androidx.compose.material3:material3-android:1.2.1@aar.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/compose/material3/material3-android/1.2.1@aar/[email protected]
       - https://repo.maven.apache.org/maven2/androidx/compose/material3/material3-android/1.2.1@aar/[email protected]
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 11s
1 actionable task: 1 executed

build gradle :

plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
}

android {
    namespace = "com.example.jetpack_compose"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.jetpack_compose"
        minSdk = 24
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.1"
    }
    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {

    implementation("androidx.core:core-ktx:1.12.0")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
    implementation("androidx.activity:activity-compose:1.8.2")
    implementation(platform("androidx.compose:compose-bom:2024.02.02"))
    implementation("androidx.compose.material3:material3")

    //view model
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
    //hilt
    implementation("androidx.hilt:hilt-navigation-compose:1.1.0-alpha01")
    //coil
    implementation("io.coil-kt:coil-compose:2.6.0")

    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    androidTestImplementation(platform("androidx.compose:compose-bom:2024.02.02"))

    // compose
    androidTestImplementation("androidx.compose.ui:ui-test-junit4")
    debugImplementation("androidx.compose.ui:ui-tooling")
    debugImplementation("androidx.compose.ui:ui-test-manifest")

    // constrains layout
    implementation ("androidx.constraintlayout:constraintlayout-compose:1.0.1")
    
    implementation("androidx.compose.ui:ui:")
    implementation("androidx.compose.ui:ui-graphics")
    implementation("androidx.compose.ui:ui-tooling-preview")
    implementation("androidx.compose.runtime:runtime:1.6.3")
    implementation("androidx.compose.runtime:runtime-livedata:1.6.3")
    implementation("androidx.compose.runtime:runtime-rxjava2:1.6.3")
    
    
    


}
0

There are 0 best solutions below