VisualStudio2017(Xamarin)でAndroidアプリのリリース準備(2019/5/12)
基本的なワークフローはMicrosoftがドキュメントを用意してくれているので、これを見る
https://docs.microsoft.com/ja-jp/xamarin/android/deploy-test/release-prep/index?tabs=windows
アプリを作るまでには以下のような手順が必要なよう。
(https://docs.microsoft.com/ja-jp/xamarin/android/deploy-test/release-prep/index?tabs=windows#Specify_the_Application_Icon)
・アイコン準備
・ファイルの圧縮
・ファイルの難読化、デバッグ不可の設定追加
・署名
・発行
下記に、実行した手順を残す。
・アイコンを作る
https://www.freelogodesign.org/
・アイコンを変換する
→①で作ったアイコンを、以下②通り作成し、ダウンロードする
(1)ic_launcherという名前で、Shape:Squareを選択
(2)ic_launcher_roundという名前で、Shape:Circleを選択
・アイコンを配置する
http://www.kurigohan.com/article/20180209_xamarin_forms_icon.html
・マテリアルデザインに変更
https://docs.microsoft.com/ja-jp/xamarin/android/user-interface/material-theme
・Dotfuscator
https://www.preemptive.com/dotfuscator/ce/docs/help/intro_install.html
・広告を載せる ※バナーうまくいかなくて挫折
GoogleのSDKのReferenceを見に行くと、Gradleを使ったやり方になっており、
Xamarinの人はどうしたらいいか途方にくれる、下のブログを見ながら広告を搭載。
https://www.aruse.net/entry/2018/09/15/114758
※GoogleAdsのパッケージは以下のNugetConsoleコマンドで取得する。
→Install-Package Xamarin.GooglePlayServices.Ads -Version 70.1501.0-preview2
■エラーとり
①TSVをintentで送ろうとしたがエラーで送れない。
MINEタイプが間違っていた。tsvを送ろう
http://androidxref.com/4.4.4_r1/xref/libcore/luni/src/main/java/libcore/net/MimeUtils.java
https://developer.android.com/guide/components/intents-filters?hl=JA
https://developer.android.com/reference/android/content/Intent.html?hl=JA#ACTION_SEND
②NU1608: 依存関係の制約外で検出されたパッケージのバージョン:
Xamarin.Android.Support.v4 26.1.0.1 では Xamarin.Android.Support.Media.Compat (= 26.1.0.1) が必要ですが、
バージョン Xamarin.Android.Support.Media.Compat 28.0.0.1 は解決されました。
→Xamarin.Android.Support.Core.Utilsをインストール
https://docs.microsoft.com/ja-jp/xamarin/essentials/troubleshooting
③ADB0020: The package does not support the CPU architecture of this device.
特定の端末はReleaseで実機に送れない模様。Debugに切り替えてビルド→配置
場所 Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 場所 E:\A\_work\1824\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:行 337
場所 Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.
場所 System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
場所 System.Threading.Tasks.Task.Execute() 0
④バナー広告が表示できない
バナーが表示できない
InterstitialのSampleコードがあったので、これで実装することに・・・悔しいけどAndroidアプリもう作らないだろう・・・。
https://developer.xamarin.com/samples/monodroid/google-services/AdMobExample/
→そのまま起動するとエラー
解決方法:構成マネージャー->配置にチェック
https://www.lisz-works.com/entry/xamarin-error-must-be-placed
⑤公開できない
http://www.cotegg.com/blog/?p=1807
→全部のチェックがグリーンにならないとだめ