LoginSignup
0
0

More than 5 years have passed since last update.

Androidアプリ開発初心者が実機で動かす時に困ったこと。

Posted at

Androidのアプリを作った初心者が困った物語を書いた投稿です。

中級者以上の方には、役立たないかもしれません。

  1. 導入
  2. 状況
  3. 原因
  4. 結論
SurfaceViewをActivityに一個だけ載せただけのあぷりをつくていました。
実機でデバックしようとしていました。
さて、実機で動かそう!ぽち!!
問題が発生したため{アプリ名}を終了します。……
エラーだー
まずは、LogCatを見てみました。
`` DeviceMonitor: Sending jdwp tracking request failed! DeviceMonitor: Adb connection Error:EOF DeviceMonitor: Connection attempts: 1 DeviceMonitor: Connection attempts: 2 DeviceMonitor: Connection attempts: 3 DeviceMonitor: Connection attempts: 4 DeviceMonitor: Connection attempts: 5 DeviceMonitor: Connection attempts: 6 DeviceMonitor: Connection attempts: 7 DeviceMonitor: Connection attempts: 8 DeviceMonitor: Connection attempts: 9 DeviceMonitor: Connection attempts: 10 DeviceMonitor: Connection attempts: 11 ``
##頭の悪い自分には、正直よくわかんなかった

今度は、Deviceの方のLogCatを見たら、なんとかわかった、
java.lang.RuntimeException: Unable to start activity ComponentInfo{アクチヴィティ名}}: java.lang.NullPointerException

これを見る限り、SurfaceViewの初期化がうまく行われていないだろうと踏んだ、、
あっSurfaceViewの初期化を忘れていた、
と思っていたら原因は違った、
原因は、

Actionbarが原因でした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0