-
Notifications
You must be signed in to change notification settings - Fork 64
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: kotlin/test/AssertionsKt Error #130
Comments
Hi @ziziana , can you give some more information? I'm no Android expert and created a new app, added
to When I add
to |
I have just created a new project myself and I get the same error. I am using Android Studio
|
Can you create a repository where you push the created project? I'm using a different Android Studio version and I'm curious if the generated Gradle files are different |
I'm getting this same error on a few projects that use Studio 3.3 and Kotlin 1.3.x |
@MarkusAmshove I pushed the project on my repo https://github.com/ziziana/repo |
Thank you, I'll try to replicate it with my current android studio version and then with 3.3 |
It seems that for my Android Studio version, the minimum supported Gradle version is 5.1-milestone-1 (this is in gradle-wrapper.properties). Could this be the problem? |
I get the following with Gradle
my guess by now is that it is actually Gradle gradle/gradle/issues/8088 seems to be exactly this issue (and is pretty recent). My guess is that the Android Studio Preview isn't ready yet, altough it is strange that a preview creates broken builds. |
To summarize:
I'm not sure where to open this issue. |
OK, thank you very much for taking time to investigate this. Will you open an issue on their side (Android Studio or/and Gradle)? I would open it myself, but I am not sure how could I help them in case they will ask me for more details. For Android Studio issues can be reported from Android Studio - Help - Submit Feedback |
I'm downloading Android Studio 3.3 at the moment and will report an issue :-) |
I'm not getting this problem with Studio 3.3, does it use Gradle 5 for you @athornz ? I'm download 3.4 now. |
I was able to reproduce it with 3.4 and opened an issue |
The issue is that Kluent includes older version (1.3.10) of some of the Kotlin libs as transitive dependencies, where as Android 3.3/3.4 only supports Kotlin 1.3.11+. This can be fixed by forcing those transitive dependencies to also use 1.3.11, i.e
|
Thank you for the hint, that's something I can fix on my end. |
They mentioned on the release note that AS 3.3 is bundled with Kotlin 1.3.11 https://android-developers.googleblog.com/2019/01/android-studio-33.html |
I'll update the kotlin version locally and see if I can use the artefact in Android |
I've updated to Kotlin 1.3.11 locally (in Kluent) and published a new version locally. The resulting POM:
The tests still fail with the same error in AS 3.4. The Gradle build runs fine though and the test passes. |
Creating a new project with AS 3.3 and targeting Kluent 1.46 (which uses Kotlin 1.3.10) does work, so I guess we're fine at the moment, as AS 3.3 is the new stable release? I still opened the issue for 3.4 at Google. |
It looks like I got the underlying reason wrong, AS just doesn't pick up kotlin-test as transitive dependency regardless of the version. Adding |
Which Gradle version does the project with 3.3 use? |
Android Gradle 3.3.0 and main Gradle 5.1.1. It runs fine on command line, just the issue with running it through AS. |
Yeah, I think this has to do with Gradle >= 5 and AS (or how AS handles Gradle), I think Google needs to sort that out |
Do we have an update wrt to this @MarkusAmshove |
I haven't heard back from Google yet, do you get this error on AS stable or on preview? |
I'm not sure about stable, but I'm getting this on 3.4 beta03. Adding the kotlin test dependency does fix the issue though. |
Oh, I think then it's related to the last conclusion in #133 and changing the dependency type might fix it. |
Have you added |
@MarkusAmshove, I'm experiencing this issue on the latest AS stable 3.3.1 (February 2019). Adding in that kotlin test dependency worked though 🍾. |
Did you add it as Also I think then it's a Gradle issue rather than AS. |
Can someone having that issue upload a newly generated android project to github, so I can test things out? |
@MarkusAmshove, should've clarified, added it with I'm using gradle (wrapper) version |
Thats strange, so maybe it is an AS issue? I'm so confused 😕 😄 |
I think I've managed to resolve the issue. Can you try and confirm with |
@MarkusAmshove, Running the tests via AS and command line both work for me 🎉. |
@MarkusAmshove I'm curious how you fixed this with the Also currently |
The packages are now in sync again. This is the change you're looking for |
Closing this issue, as it is resolved in 1.48 |
I have just added testImplementation 'org.amshove.kluent:kluent-android:1.45' to my Android project and when I run a simple test like this:
the following error is thrown:
The text was updated successfully, but these errors were encountered: