1

My IDE is Android Studio 2.0. SDK is 23
This is my error log(there are so many same logs and I list only one):

05-10 22:19:21.430 1835-1835/edu.jazzy.testconsumer E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method edu.jazzy.testconsumer.MipcaActivityCapture.access$super

my build.gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "edu.jazzy.testconsumer"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile files('libs/zxing.jar')
}

And I don't know why there is always occur error after I google for hours.

Joe
  • 410
  • 3
  • 13
  • Have you checked out this answer? http://stackoverflow.com/questions/28857860/classnotfoundexception-didnt-find-class-android-os-persistablebundle-otto-an – cristianorbs May 10 '16 at 14:57
  • @cristianorbs I have checked it, this question was the first when I google. – Joe May 10 '16 at 14:59

1 Answers1

1

You get this sort of message whenever there is code in your app that refers to classes/methods/fields that do not exist on the device. So long as you do not actually execute any lines that refer to those missing items, there is no problem.

Note that the question linked to from the comments is for a case where there is an actual crash, in that case due to some unfortunate reflection from Otto. Your error message from your question is not a crash.

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I got the error when I compiled APK, and the error occured again when I operate my app(click some button). – Joe May 10 '16 at 15:11
  • @Joe: Lots of things get logged with error severity in LogCat. Few are actual problems with your app, and most of those will be a crash with a full Java stack trace. *Other* than the message appearing in LogCat, what evidence do you have that you actually have a problem that is tied to this message? – CommonsWare May 10 '16 at 15:12
  • I am tring to implement Scan QR code, and I import some libs, some apps import the libs occur the error and cannot run, and some apps have no error and alright when it run. So I think the error is the reason make my apps crash. – Joe May 10 '16 at 15:23
  • @Joe: If your app is crashing, you will have Java stack traces to examine. Focus on those. – CommonsWare May 10 '16 at 15:53
  • Thx, you are right, I checked the log again, there were another error. I have fixed it now. Thx again – Joe May 10 '16 at 16:22