简体   繁体   中英

Kotlin multiplatform project is using old complied code

I am experimenting with kotlin multiplatform code I got some sample code running but have made changes to that code now. Every time i compile my project the old kotlin code is run instead of the new code with my changes. How do i make a clean build with the new kotlin code? i have tried invalidating the caches and restarting android, uninstalling the application, running gradle build androidJar, androidMainClasses,clean all haven't worked. Any ideas? When i try to change the name of the method i get Caused by: java.lang.NoSuchMethodError: No static method aboutMe it can't find the new method

A new build should clear out old compiled code that has changed, but if it doesn't, run gradle clean (either from a command line with the gradlew wrapper or via the gradle tasks window in Android Studio). This will remove the build directory which will cause the next build to rebuild everything and should eliminate cached code issues.

我不得不删除我的整个构建文件夹并让它重建所有内容

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM