question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code inspection and syntax highlighting is not working for Kotlin Multiplatform code on Android Studio 4.1

See original GitHub issue

Prerequisites

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

  1. Update to Android Studio 4.1
  2. Create Kotlin Multiplatform project.
  3. Create new module that contains Kotlin shared code.
  4. Add dependency of Mockk 1.10.+ version for unit test (We both tried 1.10.1 and 1.10.2)
  5. Sync gradle.
  6. 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: Screen Shot 2020-10-19 at 16 08 43

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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:7

github_iconTop GitHub Comments

4reactions
TomWayne98commented, Jan 28, 2021

This happens to me in my app project too with multiple libraries… Did you guys find some solution?

4reactions
jovikao-hycommented, Dec 18, 2020

I have the same issue. This will cause the Android studio becomes not able to identify mpp project correctly. Without mockk dependency. 螢幕截圖 2020-12-18 下午3 20 32 With mockk dependency. 螢幕截圖 2020-12-18 下午3 20 49

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found