I'm trying to create a Chat app that uses Firebase. But suddenly I'm facing this error.
02-13 10:23:02.533446 733 733 E AndroidRuntime: FATAL EXCEPTION: main
02-13 10:23:02.533446 733 733 E AndroidRuntime: Process: com.mycompany.myapp3, PID: 733
02-13 10:23:02.533446 733 733 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate application com.mycompany.myapp3.MyApplication: java.lang.ClassNotFoundException: Didn't find class "com.mycompany.myapp3.MyApplication" on path: DexPathList[[zip file "/data/app/com.mycompany.myapp3-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mycompany.myapp3-1/lib/arm, /system/lib, /vendor/lib, /system/vendor/lib]]
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:807)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5477)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.ActivityThread.-wrap2(ActivityThread.java)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.os.Looper.loop(Looper.java:203)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6251)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
02-13 10:23:02.533446 733 733 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mycompany.myapp3.MyApplication" on path: DexPathList[[zip file "/data/app/com.mycompany.myapp3-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mycompany.myapp3-1/lib/arm, /system/lib, /vendor/lib, /system/vendor/lib]]
02-13 10:23:02.533446 733 733 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.Instrumentation.newApplication(Instrumentation.java:992)
02-13 10:23:02.533446 733 733 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:801)
02-13 10:23:02.533446 733 733 E AndroidRuntime: ... 9 more
build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.mycompany.myapp3"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes {
debugg {
debuggable true
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-analytics:15+'
implementation 'com.google.firebase:firebase-storage:15+'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.google.firebase:firebase-auth:15+'
implementation 'com.google.firebase:firebase-database:15+'
}
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.myapp3" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".StartActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".RegisterActivity" />
<activity
android:name=".ResetPasswordActivity" />
<activity
android:name=".LoginActivity" />
<activity
android:name=".MainActivity" />
<activity
android:name="ChatActivity" />
<activity
android:name=".UserProfileActivity" />
<!--<activity
android:name=".ImageActivity" />-->
<activity
android:name=".DebugActivity"
android:screenOrientation="portrait"/>
<meta-data
android:name="android.max_aspect"
android:value="4.0"/>
<uses-library android:name="org.apache.http.legacy" android:required="false" />
</application>
</manifest>
I don't know how Do I fix it. I will apprentice if you can help.
NOTE: Please, I'm a beginner in this feild. I really need help. If I missed to share any information, please let me know, I'll add the information.
Thanks.