Just tried to run an app I wrote a while back, and...
# android
l
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
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
Ive had this happen where I just do a gradle clean and reinstall
l
Looks like a gradle clean and reinstall worked. I wonder what happened to the apk?