Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.0 Kotlin changes are not reflected in the build

Has anyone tried the new android studio with 3.0 for kotlin. I am seeing a weird issue where the Kotlin code changes are not reflected when I run the app but the java changes can be seen. When I debug the app, the code won't stop at the new lines of code. Also I've particularly seen that during runtime Java complains that the new method that I wrote in Kotlin cannot be found.(But the java code which was written at the same time can be seen) The only solution I've found is either to rebuild the app or uninstall and reinstall. Any solutions for this problem. NB: I've instant run OFF and also tried incremental compilation on kotlin build OFF/ON

like image 435
abat Avatar asked Jun 09 '17 09:06

abat


Video Answer


1 Answers

I was going though the same problem. I thought that the changes are not getting saved so I even tried to clean build my application but sadly that didn't work. So lately I found what's wrong is that I was using an if expression and as an expression returns a value, my call after the if expression was not getting executed not because the changes are not saved but because if was returning to the function hence no statement after the call was executed. Please check if that was the case. Hope this might help.

like image 86
guneetgstar Avatar answered Oct 21 '22 10:10

guneetgstar