rename
rename copied to clipboard
MainActivity.kt
package com.example.app
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
Need to change the package name in MainActivity.kt also.
I faced this issue when signing and building the app
I think this is not causing issue in my cases but It could be good to change also this one, if we change this one we also need to edit the folder names on android side since the package name will change
This caused an issue for me, until I renamed the class name in MainActivity.kt
:
E/AndroidRuntime(18457): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{io.github.richardjharris.JapaneseYearCalculator/io.github.richardjharris.JapaneseYearCalculator.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "io.github.richardjharris.JapaneseYearCalculator.MainActivity" on path: DexPathList[[zip file "/data/app/io.github.richardjharris.JapaneseYearCalculator-4bLXRdubbkTCHzWsETpAfQ==/base.apk"],nativeLibraryDirectories=[/data/app/io.github.richardjharris.JapaneseYearCalculator-4bLXRdubbkTCHzWsETpAfQ==/lib/arm64, /data/app/io.github.richardjharris.JapaneseYearCalculator-4bLXRdubbkTCHzWsETpAfQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]
This was the same for me, apparently it must be the same as the namespace under androidmanifestxml
I come up with a work around for new reader. Just add this line package="${your_namespace}"
to your manifest.xml, this issue will be resolved. For instance I have my namespace like in the attached image below
then my manifest.xml would be like this
If your project has already had that line, just make sure it is equal to the namespace of your project folder structure. Hope this work around help!