简体   繁体   中英

Decompiled .class file, bytecode version: 51.0 (java 7)

I am getting an error that says "source code does not match bytecode" with the description that "Decompiled.class file, bytecode version: 51.0 (java 7)" when I am calling onClickSelect() method.

It brings me to AppCompatViewInflater class and highlights its built-in onClick() method.

AppCompatViewInflater:

public void onClick(@NonNull View v) {
       if (this.mResolvedMethod == null) {
           this.resolveMethod(this.mHostView.getContext(), this.mMethodName);
       }

    try {
        this.mResolvedMethod.invoke(this.mResolvedContext, v);
    } catch (IllegalAccessException var3) {
        throw new IllegalStateException("Could not execute non-public method for android:onClick", var3);
        } catch (InvocationTargetException var4) {
            throw new IllegalStateException("Could not execute method for android:onClick", var4);
        }
    }

My code:

public void onClickSelect(View view) {
        TextView attack_pts = (TextView) findViewById(R.id.min_attack_value);
        TextView defense_pts = (TextView) findViewById(R.id.min_defense_value);
        TextView health_pts = (TextView) findViewById(R.id.min_health_value);
        Intent intent = new Intent(this, PokemonListActivity.class);
        intent.putExtra("min attack pts", attack_pts.getText().toString());
        intent.putExtra("min defense pts", defense_pts.getText().toString());
        intent.putExtra("min health pts", health_pts.getText().toString());
        startActivity(intent);
}

Can you check the.class file java version and version that you are currently using to decompile.

It should be same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM