Code inspection and syntax highlighting is not working for Kotlin Multiplatform code on Android Studio 4.1
See original GitHub issuePrerequisites
Please answer the following questions for yourself before submitting an issue.
- [√] I am running the latest version
- [√] I checked the documentation and found no answer
- [√] I checked to make sure that this issue has not already been filed
Current Behavior
We have code that created for Kotlin Multiplatform on Android project. And we are using Mockk version 1.10.+ for our Kotlin Multiplatform unit tests.
Failure Information (for bugs)
After updating to Android Studio 4.1, code inspection and syntax highlighting or navigating between code stopped. We are not able to use our tests. Debugger is not working. But that happens only for Kotlin Multiplatform code. Since regular Android modules are not using Mockk, Android Studio inspecting code without issue. On the other hand, if we downgrade our Mockk version to 1.9.2, it works perfectly. Code inspection and syntax highlighting starts working again.
Steps to Reproduce
- Update to Android Studio 4.1
- Create Kotlin Multiplatform project.
- Create new module that contains Kotlin shared code.
- Add dependency of Mockk 1.10.+ version for unit test (We both tried 1.10.1 and 1.10.2)
- Sync gradle.
- Check your Kotlin code, it won’t syntax highlighting and code inspections stops.
Context
- MockK version: 1.10.+
- OS: MacOS Catalina
- Kotlin version: 1.4.10
- JDK version: 8
- JUnit version:
- Type of test: unit test for Kotlin Multiplatform
- Dependencies we use:
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation kotlin('test-junit')
implementation 'io.mockk:mockk:1.10.0'
}
}
Failure Logs
Screenshot:
Stack trace
Unable to build Kotlin project configuration</b><eol>Details: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find mockk-1.10.0-samplessources.jar (io.mockk:mockk:1.10.0).<eol>Searched in the following locations:<eol> https://jcenter.bintray.com/io/mockk/mockk/1.10.0/mockk-1.10.0-samplessources.jar</i>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:7
Top Results From Across the Web
Syntax highlighting fails in Kotlin Multiplatform project
I solved the issue by going to File > Manage IDE Settings and clicking Restore Default Settings. Then it restarted, took me through...
Read more >Kotlin IDE support (syntax highlighting, suggestions etc.) not ...
Hi,. for a few days now the Kotlin IDE support doesn't work properly. Only some keywords are highlighted, suggestions only pop up when...
Read more >Android Studio 2022.1.1 Closed Issues
Issue #189340127. Jetpack Compose syntax highlighting is inconsistent ... Issue #71512163. Refactor -> Modularize tool doesn't work with Kotlin code ...
Read more >Syntax Highlighting Fails In Kotlin Multiplatform ... - ADocLib
We have code that created for Kotlin Multiplatform on Android project. Check your Kotlin code it won't syntax highlighting and code inspections stops....
Read more >Cannot call testImplementation(), receiver type mismatch
Code inspection and syntax highlighting is not working for Kotlin Multiplatform code on Android Studio 4.1. opened 08:06AM - 20 Oct 20 UTC....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This happens to me in my app project too with multiple libraries… Did you guys find some solution?
I have the same issue. This will cause the Android studio becomes not able to identify mpp project correctly. Without mockk dependency.
With mockk dependency.
