My application is a custom class that extends MultiDexApplication.
public class CustomApp extends MultiDexApplication { @Override public void onCreate() { super.onCreate();
In my AndroidManifest.xml:
<application android:name=".helper.CustomApp" android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="${app_name}" android:largeHeap="true" android:screenOrientation="portrait" android:supportsRtl="true" android:theme="@style/AppTheme" tools:replace="android:allowBackup, android:label">
When I try to run apk on samsung s6 (API 7.0), everything works fine. BUT, when I try to run it on THOMSON (API 4.2.2), I get this error:
FATAL EXCEPTION: main java.lang.RuntimeException: Unable to instantiate application me.blu.app.helper.CustomApp: java.lang.ClassNotFoundException: Didn't find class "me.blu.app.helper.CustomApp" on path: DexPathList[[zip file "/data/app/me.blu.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/me.blu.app-1, /vendor/lib, /system/lib]] at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
So, I did that - I created the multidex-config.txt file and added this line:
me/blu/app/helper/CustomApp.class
This file is next to my build.gradle file as needed.
Then I added this multiDexKeepFile file('multidex-config.txt') to my two builTypes, but ALSO below multiDexEnabled true .
It still does not work. I would greatly appreciate some help ^^
Thanks.
source share