3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Unityで INSTALL_FAILED_VERSION_DOWNGRADEが原因で実機テストが出来ない

Posted at

これまで何度も実機(Androidスマホ)でテスト出来ていたにもかかわらず、ある日突然Build and runでエラーがおきた。

コンソールを見ると以下のメッセージが

[Qiita]
Installation failed with the following output:
[ 0%] /data/local/tmp/Package.apk
(省略)
[100%] /data/local/tmp/Package.apk
pkg: /data/local/tmp/Package.apk

Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

どうやらApkのインストールが失敗しているらしい。

そして答えがまるまる書いてあるのだがINSTALL_FAILED_VERSION_DOWNGRADEと書かれている。

何が起こったかというと、スマホ側にインストールしてあるアプリのVersionの方が新しいと誤解されてしまい
「ダウングレードは無理」と怒られている状態。

これを解決するにはUnityのEdit -> Project Settings -> PlayerでPlayer Settingsを開き
AndroidのタブにあるOther SettingsでVersion/Bundle Version Codeを、スマホ側よりも新しいものにする。

それが嫌ならアプリをアンインストールして、再度インストールすればいい。(これならVersionのチェックが起こらない)

で、なぜこのような問題が起こるかというと
複数のPCでUnityを使っているときに起こりやすい。(Github/Bitbucketなども併用)
あるPCでVersion1.10を作ったのに、それを忘れて別のPCでVersion1.09という名前で作ろうとすると
「それはダウングレードだから無理だよ」と怒られる。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?