![](/img/trans.png)
[英]How can I fix error "decompiled .class file bytecode version 52.0 (Java 8)
[英]Decompiled .class file, bytecode version: 51.0 (java 7)
当我调用onClickSelect()
方法时,我收到一条错误消息,显示“源代码与字节码不匹配”和“Decompiled.class 文件,字节码版本:51.0 (java 7)”的描述。
它将我带到AppCompatViewInflater
class 并突出显示其内置的onClick()
方法。
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);
}
}
我的代码:
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);
}
你能检查一下.class文件java版本和你当前用来反编译的版本。
应该是一样的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.