2016-06-25 65 views
2

我無法找到針對此應用程序中過去3小時內發生的意外錯誤的解決方案。它一直運行到現在完全一樣。

一切都已附加到這個問題。 我無法從其他帖子中找到解決方案我嘗試了他們的解決方案,但他們不適用於我,例如將生成版本從23.3.0更改爲23.0.0 012SDcompileSDKVersion也與構建版本相同,我不知道爲什麼我得到這個錯誤。

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

      } 
     }); 
    } 

回答

0

好吧,幫助我的東西是: 我將我的android插件版本從2.1.2降級到1.5.0,清理了構建並測試了我的應用,並且沒有錯誤了, 我不知道爲什麼插件會產生問題。