d

    Darren Lambert

    1 year ago
    Hey guys, i try Jetpack Compose for my projet and i get a render problem when i want to preview a composable, do you have any solution to resolve this issue. Gradle Bluid: My Code:
    class MainActivity : ComponentActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContent {
                    // A surface container using the 'background' color from the theme
                    Surface(color = MaterialTheme.colors.background) {
                        Greeting("Android")
                    }
            }
        }
    }
    
    @Composable
    fun Greeting(name: String) {
        Text(text = "Hello $name!")
    }
    
    @Preview(showBackground = true,name="Text Preview")
    @Composable
    fun DefaultPreview() {
    
            Greeting("Android")
    }
    Message of the error : Attach Msg Error.txt 😕
    ..
    a

    Abhishek Dewan

    1 year ago
    @Darren Lambert please post code in threads https://kotlinlang.slack.com/archives/CJLTWPH7S/p1614355175421600
    Hence the :thread-please: response on the message
    Chachako

    Chachako

    1 year ago
    Agreed, please move your long message into this thread
    d

    Darren Lambert

    1 year ago
    Sorry i will do this 😅
    here the code of Build gradle & the Error