Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoSuchMethodError: No static method setContent #123

Closed
yektasarioglu opened this issue Dec 15, 2020 · 11 comments
Closed

java.lang.NoSuchMethodError: No static method setContent #123

yektasarioglu opened this issue Dec 15, 2020 · 11 comments

Comments

@yektasarioglu
Copy link

yektasarioglu commented Dec 15, 2020

I'm using 1.0.0-alpha08 version which is the same compose version as the library. Any ideas on how to solve it?

java.lang.NoSuchMethodError: No static method setContent$default(Landroidx/activity/ComponentActivity;Landroidx/compose/runtime/Recomposer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Landroidx/compose/runtime/Composition; in class Landroidx/compose/ui/platform/WrapperKt; or its super classes (declaration of 'androidx.compose.ui.platform.WrapperKt' appears in /data/app/com.yektasarioglu.testapp.debug-ZwvsZzo9Jrsy4DLjhICVeg==/base.apk)
        at com.airbnb.android.showkase.ui.ShowkaseBrowserActivity.onCreate(ShowkaseBrowserActivity.kt:26)
        at android.app.Activity.performCreate(Activity.java:8085)
        at android.app.Activity.performCreate(Activity.java:8073)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1320)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3870)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4076)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2473)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8349)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
@vinaygaba
Copy link
Collaborator

@yektasarioglu If you try the latest version of Showkase alpha04, it should fix the issue. Also use the latest version of compose that just launched (alpha09). This combination should def fix the issue in my opinion. Let me know if you observe otherwise.

@yektasarioglu
Copy link
Author

yektasarioglu commented Dec 21, 2020

@vinaygaba I encountered this compiler error after upgrading to alpha09. Also, Showkase alpha04 uses alpha09 of Compose. Thus, these upgrades prevent me to build the project for the testing. I would share the result as soon as I can test it. Thank you for getting back to me.

@vinaygaba
Copy link
Collaborator

@yektasarioglu Yeah I recently bumped up Showkase to use the latest version of compose. Unfortunately, compose versions aren't compatible among each other so you will have to upgrade your compose version to alpha09 :( I have no control over that unfortunately as that is a compose compatibility issue.

@yektasarioglu
Copy link
Author

I did but I still got the same compiler error :/

@vinaygaba
Copy link
Collaborator

@yektasarioglu Okay let me take a deeper look at this and see if I can repro. Is the stack trace identical? Were you using any other compose libraries like navigation, paging, accompanist, etc?

@yektasarioglu
Copy link
Author

Accompanist is the only compose library that I use at the moment.

@vinaygaba
Copy link
Collaborator

@yektasarioglu And are you using this version - https://github.com/chrisbanes/accompanist/releases/tag/v0.4.1
Because the older version of Accompanist will not work with compose alpha09

@yektasarioglu
Copy link
Author

Yes. I did upgrade Accompanist to the latest 0.4.1 version and unfortunately still getting this compiler issue.

@vinaygaba
Copy link
Collaborator

@yektasarioglu So I just tested it on an existing project and I did not encounter this issue. Try to invalidate the cache and build again and if that doesn't work either, could you publish your project on github so that I can take a look.

@yektasarioglu
Copy link
Author

@vinaygaba I tried almost any tricks to get a successful build so that I can test it but it seems to be a Compose compiler issue rather than any other libraries. There are already three open issues about it. I also created another Empty Compose Activity from templates to simulate this issue on a new project as well. And this issue is fixed but the other project which I got this experiencing this compose compiler issue whatever I try. Thanks, Vinay for your efforts 👍

@igorwojda
Copy link

I am observing this as well with 1.0.0-beta07. This fixed the issue for me

// app Gradle file
android
{
	...
	buildFeatures {
    	compose true
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants