我无法找到针对此意外错误的解决方案,该错误已从我的应用中的过去3个小时开始出现。到目前为止,它运行得非常完美,所有功能都完全相同。

一切都附有这个问题。
我从其他尝试过的解决方案的帖子中找不到解决方案,但是它们对我不起作用,例如将构建版本从23.3.0更改为23.0.0
compileSDKVersion也与构建版本相同,我不知道为什么会收到此错误。

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

这是我的日志:

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();
                }

            }
        });
    }

最佳答案

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

07-26 09:41