简体   繁体   中英

APK not Installing in Kitkat?

When I run through Android Studio is App get Installing working fine above 4.0 version...when I take apk file from app>build>output>apk I am trying to install I get the error below like this...

Note:(Same apk file working 5.0 and 6.0)

I tried all google suggestions.

Error:

FATAL EXCEPTION: main Pocess: app.idea.com.ideadarpan, PID: 1032 java.lang.RuntimeException: Unable to instantiate application app.idea.com.ideadarpan.commonclass.Idea_Urban: java.lang.ClassNotFoundException: Didn't find class "app.idea.com.ideadarpan.commonclass.Idea_Urban" on path: DexPathList[[zip file "/data/app/app.idea.com.ideadarpan-1.apk"],nativeLibraryDirectories=[/data/app-lib/app.idea.com.ideadarpan-1, /vendor/lib, /system/lib, /system/lib/arm]] at android.app.LoadedApk.makeApplication(LoadedApk.java:516) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553) at android.app.ActivityThread.access$1500(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.jav a:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassNotFoundException: Didn't find class "app.idea.com.ideadarpan.commonclass.Idea_Urban" on path: DexPathList[[zip file "/data/app/app.idea.com.ideadarpan-1.apk"],nativeLibraryDirectories=[/data/app-lib/app.idea.com.ideadarpan-1, /vendor/lib, /system/lib, /system/lib/arm]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at android.app.Instrumentation.newApplication(Instrumentation.java:975) at android.app.LoadedApk.makeApplication(LoadedApk.java:511) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553) at android.app.ActivityThread.access$1500(ActivityThread.java:139) at android.app.ActivityThread$H.ha ndleMessage(ActivityThread.java:1353) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) at dalvik.system.NativeStart.main(Native Method)

APP:Builde.gradle: I have used Four JAR file for pdf and also Covert Json to Excels it's in lib folder i have to use the same version only.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "app.idea.com.ideadarpan"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        dexOptions {
            jumboMode true
        }
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/dependencies.txt'
            exclude 'META-INF/LGPL2.1'
        }

    }
    dexOptions
            {
                javaMaxHeapSize "2048M"
                preDexLibraries = false
                // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY
            }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:cardview-v7:25.2.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'io.reactivex.rxjava2:rxjava:2.1.3'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'com.google.firebase:firebase-core:9.4.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Application Class:

public class Idea_Urban extends MultiDexApplication {
    private static Idea_Urban idea_urban;
    private SharedPreferences mSharedPreferences;
    public static Context context;

    public int recy_postion;

    public static Idea_Urban getInstance() {
        return idea_urban;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        idea_urban = this;
        initSharedPreferences();

       }
}

Any one help me please.

Your given information is inconsistant. At title, you say that not working at KitKat(4.4) but in the question, you say working above 4.0 .

Android 4.0, 4.0.1, 4.0.2 is API level 14 , which is lower than your minSDK level( 15 ).

If you try to run this app on 4.0, 4.0.1, 4.0.2 devices, it will not work. You may update the question with exact version name you have tried.

You can lower change minSdkVersion at gradle.

Have you tried to make build by disabling instant run? Goto File -> Settings -> Build,Execution, Deployment -> Instant Run -> Uncheck the checkbox for instant run

This may be the reason. Plase, check that also. I am not sure about this. But just give a try :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM