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.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/FunctionReference; #2837
Comments
Okay, if I get it right — you managed to fix your problem. |
Yup. Don't have any issues using Detox with Jest 26 once I applied the proguard line to keep the kotlin classes. I think perhaps we could have a troubleshooting section anyone who faces anything along the lines of java.lang.ClassNotFoundException: kotlin.* then we could suggest them by creating their own proguard rules and applying that along with the proguard rules that come with detox. |
I'm looking into the option of adding these rules to Detox' application rules-set. |
@zanechua Thanks for reporting this in spite of having it solved! As explained - I do wish to have this solved across the board via Detox itself. A piece of info that could help for that, is to know whether your app uses Kotlin at all (i.e. has the kotlin std-lib defined as its dependency + has the classpath defined), or that it is in fact java-only (more info). |
As far as i know, we only have the classpath defined in the project like you see above in the There are only 3 references to the keyword
I have nothing else in my react-native project that uses kotlin. A cursory look at kotlin in the node_modules folder seems to be pointing mainly to |
@zanechua please upgrade to Detox Thanks for the additional info 🙏🏻 |
Just upgraded to Now the error has just changed to:
Not sure if you guys are comfortable with using the wildcard rule for kotlin instead of just the individual function calls |
@d4vidi - This has worked for me, thank you. |
@zanechua Truly interested in finding out what it is about your project that poses such a challenge to Detox' proguard rules files 😂 |
@d4vidi I would like to know too. hahaha. If I get some free time, I'll go see if I can find which package is being the annoying one but the proguard rule with wildcards will have to do for now. 😆 |
@zanechua I don't mind, in particular, to include all of Kotlin's internals - the overhead would be very small. It's more about being able to understand this better, obviously. |
@zanechua In https://github.com/wix/Detox/pull/2909/files, I've expanded the minification exemption rule with respect to |
@zanechua Thank you man! You saved me additional hours spent wondering why my tests are failing. @d4vidi Is it possible to describe more precisely in the docs the required changes in the configuration if someone wants to use an additional build type solution with flavors 7-proguard-minification-obfuscation or can we add the link to this issue at the end of the note The non described changes that were crucial in my case: Additionally, if someone has enabled Hermes the following line should be added to |
|
@arjun1194 that gradle task isn't something wide-spread, you probably shouldn't be looking for it in your own project. Rather, you probably need something like |
Describe the bug
I don't particularly need help since I've resolved it but just opening it incase someone runs into the issue too.
Unable to launch release app via detox as app fails with:
This seems similar to #1994 and the fix for me was found here by applying the
-keep class kotlin.** { *; }
proguard rule for a releaseE2E build type. I can see that one of the maintainers asked if that would help and I can confirm it does for me.Steps To Reproduce
./gradlew assembleDevReleaseE2E assembleDevReleaseE2EAndroidTest -DtestBuildType=releaseE2E
yarn detox test -c android.emu.release
build.gradle
app/build.gradle
proguard-rules-e2e.pro
Expected behavior
App to launch, tests to run and complete
Detox Trace-Logs
Device logs (adb logcat)
Screenshots
N/A
Environment (please complete the following information):
jest-circus
The text was updated successfully, but these errors were encountered: