Android用のエミュレーターでエラーなしで正常に動作するアプリがあります:
- 2.1
- 2.3.3
- 4.03
4.03 タッチパッドでも問題なく動作します。
ただし、Google Play のクラッシュ エラー レポートには次のように記載されています。
main_menu のエラー。< init >() 26 レポート
(注: ニンジンのオープン/クローズと「init」の間にスペースはありませんが、stackoverflow ではそれができません)
ユーザーは私に電子メールを送り、2.3.3 を実行している Samsung Galaxy S で発生し、エラーなしで起動時にクラッシュすると言いました。
これは、main_menu.java のスニペットです。正直なところ、これをどこから始めればよいかわかりません。. . 何か案は?
ps - 私は Android プログラマーが苦手なので、親切に詳しく説明してください。. .
package robot_calc.android;
import sor.robotics.calculators.R;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.widget.Button;
import android.view.View;
public class main_menu extends Activity
{
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.main_menu);
Button bOhm = (Button) findViewById(R.id.btnOhmClick);
Button bLed = (Button) findViewById(R.id.btnLedClick);
Button bBat = (Button) findViewById(R.id.btnBatClick);
Button bEnc = (Button) findViewById(R.id.btnEncClick);
bOhm.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Intent i = new Intent(main_menu.this, ohm_calculator.class);
startActivity(i);
}
});
bLed.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Intent i = new Intent(main_menu.this, led_calculator.class);
startActivity(i);
}
});
bBat.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Intent i = new Intent(main_menu.this, battery_calculator.class);
startActivity(i);
}
});
bEnc.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Intent i = new Intent(main_menu.this, encoder_calculator.class);
startActivity(i);
}
});
}
}
Google Play からのスタック トレース:
java.lang.Error: Unresolved compilation problems:
The import sor.robotics.calculators.R cannot be resolved
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
at robot_calc.android.main_menu.<init>(main_menu.java:8)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1409)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)