-2

After working on a project for about a month, my project started executing errors.. Whenever I'm trying to run the program via phone, it executes "app stopped working".. I monetize to check "android monitor" to know who causes the error..(FATAL EXCEPTION: main):

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.app.programavima.java.javaprogramavimas.MainActivity" on path: DexPathList[[zip file "/data/app/com.app.programavima.java.javaprogramavimas-1/base.apk", zip file "/data/app/com.app.programavima.java.javaprogramavimas-1/split_lib_slice_7_apk.apk"],nativeLibraryDirectories=[/data/app/com.app.programavima.java.javaprogramavimas-1/lib/arm64, /vendor/lib64, /system/lib64]]

Am I missing these "base.apk", "arm64", "lib64" files? Maybe something else is making my app to executes errors?

Every help would be pleased, I can manage to import some code, because there's a lot of files inside my project

T. Jony
  • 61
  • 1
  • 9
  • Most likely that problem is in multidexing. Read how to enable it here: https://developer.android.com/studio/build/multidex.html –  Ekalips Sep 13 '17 at 11:45
  • The exception is complaining it cannot find a class and also telling you where it searched... Is the class file in that path? Are spellings correct? – Hassan Sep 13 '17 at 11:45
  • Those sliced apks are a result of instant run. You might have installed an incomplete apk with changes only. Do a clean rebuild and push to device via studio. see https://stackoverflow.com/a/43383316/5948415 – Elvis Chweya Sep 13 '17 at 11:47

1 Answers1

0

Modify the module-level build.gradle file to enable multidex and add the multidex library as a dependency, as shown here:

android {
    defaultConfig {
        ...
        minSdkVersion 15 
        targetSdkVersion 26
        multiDexEnabled true  // add this line
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'  // add this library
}

In your manifest update with this code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">
    <application
            android:name="android.support.multidex.MultiDexApplication" >  // add this line
        ...
    </application>
</manifest>
Bhuvanesh BS
  • 13,474
  • 12
  • 40
  • 66