https://kotlinlang.org logo
#android
Title
# android
l

Landry Norris

10/05/2023, 9:22 AM
Just tried to run an app I wrote a while back, and it suddenly crashes with an error that says it can't find the MainActivity on the classpath. I haven't updated the code in a few months, and it worked last I uploaded code. Has anyone seen this before?
not kotlin but kotlin colored 3
j

Jeff Lockhart

10/05/2023, 2:19 PM
Usually the thing that older apps need is to remove the
package=<http://com.example.app|com.example.app>
attribute from the AndroidManifest.xml and put it in build.gradle:
Copy code
android {
    namespace "<http://com.example.app|com.example.app>"
    ...
}
Oh, and the other thing that this error is likely caused by, make sure the
<activity>
in the manifest has the attribute
android:exported="true"
.
👍 1
c

Colton Idle

10/06/2023, 11:54 AM
Ive had this happen where I just do a gradle clean and reinstall
l

Landry Norris

10/06/2023, 10:26 PM
Looks like a gradle clean and reinstall worked. I wonder what happened to the apk?