LoginSignup
1
1

More than 3 years have passed since last update.

Androidの実機でデバック中に配置エラーが出た場合の対処

Last updated at Posted at 2019-12-07

メモ書きみたいなものですが、ちょっとハマったので書きます。

Xamarin Formsのアプリを作成中、実機をアップグレードしたら下記のエラーで配置できなくなった。エミュレータだと実行できる。

Mono.AndroidTools.RequiresUninstallException: The installed package is incompatible. Please manually uninstall and try again.

まあ、手動でuninstallしろってことなんだけど、既に実機のアプリは削除してある。やり方がわからなくて調べた。

どうやらadbコマンドを使うらしい。

VS2019の「ツール」→「Android」→「Android Adb コマンドプロンプト」でAndroid Adb コマンドプロンプトを立ち上げる。

「よく使うadbのコマンド」を参照する。
https://qiita.com/t2low/items/cb37cec5f864c4748e14

アプリ名は「FileUploader」なので、
adb shell pm list packages file
で探すけど見つからない。

エミュレータの方で同じコマンドを打ち込むと、「com.xxxxxx.FileUploader」が引っ掛かった。

ちなみにパッケージ名は「AndroidManifest.xml」でも確認できる。

そこで、
adb uninstall com.xxxxxx.FileUploader
でアプリを消すことができた。

無事に配置実行までできた。

1
1
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
1
1