https://kotlinlang.org logo
w

wuseal

01/28/2021, 2:42 AM
Hi, bros, I found a bug in Android Studio : 1. Composite build cant reference shared library class in commonMain by Android Studio, but I can manually import the class into main project by writing
import com.xxxxx.xx.xx.X
  The android Studio doesn't tips you to do auto import classes Android Studio Version: 4.2 beta3 Gradle Version: 6.5 Kotlin Plugin Version : 1.4.21-release-Studio4.2-1 KMM Plugin: 0.2.0-release-65-Studio4.2 JVM: 15 Kotlin: 1.4.21 Can you guys understand what i mean? And how to let people to resolve this problem? I need this coding style with gradle composite build to Isolate the KMM build environment 😊
m

Michal Klimczak

01/28/2021, 7:09 AM
There problems with import in multiplatform project all over the place. Sometimes my import from libraries are messed up, sometimes from module to module. What might work for you is manually marking a directory as sources root. Right click on the dir containing the package (e.g. 'kotlin' containing your 'wu.seal...' and Mark as, Sources root
w

wuseal

01/28/2021, 10:12 AM
@Michal Klimczak Thank you for heart rely, I'v try it, but it doesn't work for me , because it's origin
sourecs root
as the picture show
m

mboudraa

01/28/2021, 8:37 PM
I actually have the exact same problem 😞
😕 1
m

Michal Klimczak

01/29/2021, 12:30 PM
Maybe this will help you. Today I had a problem where everything was fine until I used gradle clean. Then all my imports were messed up and nothing helped. I had
compileSdkVersion(30)
in the
android{
section of my build.gradle. When I changed it to 29, everything starts working fine again
w

wuseal

01/29/2021, 12:58 PM
@Michal Klimczak So strange, omg
7 Views