找不到课程' android.os.PersistableBundle' package.access $ super

时间:2016-06-25 22:48:49

标签: android android-studio android-studio-2.1

我无法找到这个意外错误的解决方案,该错误已在我的应用中过去3小时开始。它一直运行到现在,一切都完全相同。

这个问题附有一切。 我无法从其他帖子中找到解决方案,我尝试了他们的解决方案,但它们对我不起作用,例如将构建版本从23.3.0更改为23.0.0 compileSDKVersion也和build版本一样,我不知道为什么会出现这个错误。

我的android studio版本是2.1.2,我在API 19上运行这个应用程序。

这是我的logcat:

E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:14.995 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:14.995 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:14.995 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:14.997 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:14.999 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:15.000 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:15.002 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:15.006 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:15.008 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:15.010 4130-4130/ com.mypackage.test E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method  com.mypackage.test.HowToUse.access$super
06-26 04:04:15.212 4130-4506/ com.mypackage.test E/WifiManager: mWifiServiceMessenger == null

的gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.mypackage.test"
        minSdkVersion 10
        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/StartAppInApp-3.3.2.jar')
}

java代码:

Button btngrp,btnppl,btnnext;
    LinearLayout hidden_share;
    private StartAppAd startAppAd = new StartAppAd(this);
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_share_screen);

        grp = (TextView)findViewById(R.id.tvgrp);
        ppl = (TextView)findViewById(R.id.tvppl);

        btngrp = (Button)findViewById(R.id.btngrpshare);
        btnppl = (Button)findViewById(R.id.btnindshare);
        btnnext = (Button)findViewById(R.id.btnnext);

        hidden_share = (LinearLayout)findViewById(R.id.hiddenshare);
        hidden_share.setVisibility(View.GONE);

        btngrp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startAppAd.showAd();
                startAppAd.loadAd();
                share();
                if(isNetworkAvailable()) {
                    int nos= Integer.parseInt(grp.getText().toString());
                    nos--;
                    if(nos==-1){
                        hidden_share.setVisibility(View.VISIBLE);
                    }else {
                        grp.setText("" + nos);
                    }
                }else{
                    Toast.makeText(getApplicationContext(),"No internet found, Please make sure you are connected to internet",Toast.LENGTH_SHORT).show();
                }

            }
        });

        btnppl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startAppAd.showAd();
                startAppAd.loadAd();
                share();
                if(isNetworkAvailable()) {
                    int nos= Integer.parseInt(ppl.getText().toString());
                    nos--;
                    if(nos==-1){
                        hidden_share.setVisibility(View.VISIBLE);
                    }else {
                        ppl.setText("" + nos);
                    }
                }else{
                    Toast.makeText(getApplicationContext(),"No internet found, Please make sure you are connected to internet",Toast.LENGTH_SHORT).show();
                }

            }
        });

        btnnext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startAppAd.showAd();
                startAppAd.loadAd();
                if(isNetworkAvailable()) {
                    startActivity(new Intent(ShareScreen.this,Capcha.class));
                }else{
                    Toast.makeText(getApplicationContext(),"No internet found, Please make sure you are connected to internet",Toast.LENGTH_SHORT).show();
                }

            }
        });
    }

1 个答案:

答案 0 :(得分:0)

好的,帮助我的是: 我将我的Android插件版本从2.1.2降级到1.5.0,清理了构建并测试了我的应用,并且没有任何错误, 我不知道为什么插件会产生问题。