Learn About Composable Functions | raywenderlich.com

Play around with some of the basic Composable functions, and learn what their parameters are, and how to display a simple Composable tree.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/21959310-jetpack-compose/lessons/2
1 Like

Can anybody help me to resolve problem with calling

private fun showAddBook() {
val addBook = registerForActivityResult(…)

?
I have issue

Fragment BooksFragment{4e3a765} (73bdb62e-b7e2-4ade-bad1-1ee759cca479 id=0x7f0800c2) is attempting to registerForActivityResult after being created. Fragments must call registerForActivityResult() before they are created (i.e. initialization, onAttach(), or onCreate()).

thanks
L

Ok. Now I already know how to solve it.
switch to branch 2.0 :smiley:

I’m not trying to be mean, but my feedback would be to slow down when explaining things. You’re talking really fast and because of that not clearly articulating.

Switch to breanch 2.0 and check what’s changed between 1.1 and 2.0 code.
Code in 2.0 branch works ok.

I have tried running the project in stable AS as well as canary AS. I am getting same error while syncing the project. Any idea?

Unable to find method ''void com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTests$default(com.android.build.api.extension.AndroidComponentsExtension, com.android.build.api.extension.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)''
'void com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTests$default(com.android.build.api.extension.AndroidComponentsExtension, com.android.build.api.extension.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)'

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Hey @adrian110288 !

I’ve dug around a bit and it seems this might be an issue for you:

IT seems there might be some libraries which are not compatible based on your AGP. So try updating the AGP as well as library versions to see if that helps!

Yup, what @filbabic linked to is right.

Specifically for me updating build.gradle to have this version of the hilt plugin:

 classpath 'com.google.dagger:hilt-android-gradle-plugin:2.39.1'

and app/build.gradle to have this version of hilt:

  implementation "com.google.dagger:hilt-android:2.37"
  kapt "com.google.dagger:hilt-android-compiler:2.37"

let the app compile on the latest Android Studio