On the Nexus One studio emulator with android 4.2.2 and api 17 everything works, and on the Asus K012 tablet with android 5.0 and api 21 here is such a heresy:
05-09 08:35:32.204 12166-12166/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.studio.morpheus.morpheusholodos, PID: 12166 java.lang.VerifyError: Rejecting class com.studio.morpheus.morpheusholodos.MainMenu because it failed compile-time verification (declaration of 'com.studio.morpheus.morpheusholodos.MainMenu' appears in /data/app/com.studio.morpheus.morpheusholodos-2/base.apk) at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.Class.newInstance(Class.java:1572) at android.app.Instrumentation.newActivity(Instrumentation.java:1065) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2217) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2376) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5253) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) I read on the Internet about this problem. People who had it, described it with incredibly abstruse words, which I could not even read, and solutions were offered to them even less intelligible. But my program is not one of which you can say something like that, everything in it is extremely simple. Why do I need it?
UPD Everything that is in the code, in a simplified version
Button blahblahbut; public static String[]blahblah= new String[666]; public static Drawable[]blahblahblah= new Drawable[666]; public static Drawable[]blahblahblah2= new Drawable[666]; public static String[][] blaaahblah= new String[666][]; SharedPreferences prefs; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_menu); setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); String[] otherblahblah={"some","items","..."}; blahblah[0]=this.getString(R.string.somestring); blaaahblah[0]=otherblahblah blahblahblah[0]=ResourcesCompat.getDrawable(getResources(), R.drawable.петросян_точка_жпг, null); System.arraycopy(blahblahblah, 0, blahblahblah2, 0, blahblahblah.length); StringTokenizer getsomemoreblahblah= new StringTokenizer(blahblah[0],"•"); blahblah[0]=getsomemoreblahblah.nextToken().replace("\n", ""); blahblahbut.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.blahblahbut: Intent blahintent= new Intent(this, blahblahactivity.class); AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom)); builder.setTitle("Бла бла бла!") .setMessage("Что ж тут может не работать?") .setCancelable(false) .setNegativeButton("Хз :(", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); prefs = PreferenceManager.getDefaultSharedPreferences(MainMenu.this); if (prefs.getString(blahblah[0], "").isEmpty) {blahintent.putExtra("blahblah",blahblah);startActivity(blahintent);}else{ Toast.makeText(this, "Не бла бла :(", Toast.LENGTH_SHORT).show();} break;