My project does not present any errors in the sync gradles, but when I run the app, there is a crash and the following error:
FATAL EXCEPTION: main Process: com.example.edson, PID: 10843 java.lang.RuntimeException: Unable to instantiate application com.example.edson.MyApplication package com.example.edson: java.lang.ClassNotFoundException: Didn't find class "com.example.edson.MyApplication" on path: DexPathList. And also says: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.edson.MyApplication" on path: DexPathList
However, MyApplication is properly located in the package of the project and it has the following content:
package com.example.edson
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
@HiltAndroidApp
class MyApplication : Application()
Also, AndroidManifest.xml is properly written:
application
android:name=".MyApplication"
Also, when I run ./gradlew assembleDebug, there is no errors at all as well.
So, I do not know what is happening. I really appreciate any help and I can share more data as required.
this issue happened when I tried to refactor to viewmodel style and also implement database room (many functions with no use still).