facebook twitter hatena line email

「Unity/公開/Android」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
("android:exportedは使用されていません"とエラーとなるとき)
("android:exportedは使用されていません"とエラーとなるとき)
行62: 行62:
 
                   android:theme="@style/UnityThemeSelector"
 
                   android:theme="@style/UnityThemeSelector"
 
+                  android:exported="true"
 
+                  android:exported="true"
>
+
                  >
 
</pre>
 
</pre>
 
外部アプリから呼び出しを、NGとする場合は、android:exported="false"とすればよい。
 
外部アプリから呼び出しを、NGとする場合は、android:exported="false"とすればよい。
  
 
参考:https://xrdnk.hateblo.jp/entry/2021/11/05/115104
 
参考:https://xrdnk.hateblo.jp/entry/2021/11/05/115104

2022年1月13日 (木) 18:14時点における版

Androidを公開する

以下を参考に実機で動かせるようにする

unity/実機/Android [ショートカット]

  1. File/BuildSettingsを選択
  2. Androidを選択
  3. PlayerSettingsを選択
  4. Inspector/端末マーク/PublisingSetting
  5. "Create〜"を選択しKeystoreを作成
  6. "Use a〜"を選択Keystoreのパスを入力する
  7. Buildするとapkができるのでそのままplay.consoleへ登録する

UnityException: Can not sign the application Unable to sign the application; please provide passwords!エラーが出る場合

keystoreのパスが空欄など


UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.エラーが出る場合

  • sdkのpathに日本語が入ってる
  • playから公開用apkを既にインストールしており、updateに失敗する(この場合は端末に入ってるアプリを消せば良い)

Please set the Bundle Identifier in the Player Settings. The value must follow the convention 'com.YourCompanyName.YourProductName' and can contain alphanumeric characters and underscore. Each segment must not start with a numeric character or underscore.のエラーが出るとき

Bundle Identifierに"-"などが含まれていると上記エラーとなる

Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for details.のエラーが出るとき

http://dl.google.com/android/repository/tools_r22.0.5-macosx.zip 少し古いtoolsをdlしてsdkの下のtoolsを更新する

参考:http://nn-hokuson.hatenablog.com/entry/2017/09/05/202327

trouble writing output: Too many field references to fit in one dex file: 71337; max is 65536. You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.エラーのとき

AndroidのBuildオプションのBuild SystemをGradleにする

参考:https://documentation.onesignal.com/docs/troubleshooting-unity

NDK is missing a "platforms" directory.エラーのとき

詳細エラー: If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

SDKManagerから"sdk tools"タブをクリックし、NDKをインストールする

"デバッグを無効にする必要"とでる場合

以下エラーの場合

アップロードできませんでした
デバッグ可能な APK または Android App Bundle をアップロードしました。セキュリティ上の理由により、Google Play に公開するにはデバッグを無効にする必要があります。詳しくは、デバッグ可能な APK または Android App Bundle についての説明をご覧ください。

Build Setting/Development Buildをoffにする

64 ビット要件に準拠してない場合

以下メッセージが出る

このリリースは Google Play の 64 ビット要件に準拠していません。

ProjectSettingのAndroidのConfiguration/ScriptingBackendをIL2CPPにし、ARM64をチェック

"android:exportedは使用されていません"とエラーとなるとき

以下メッセージが出る

unity 'android:exported' プロパティ セットは使用されていません。このファイルは Android 12 以降にはインストールできません。

android:exportedを宣言していない場合にエラーが出るようなので、 以下を、android:exported="true"を追加する

<activity android:name="com.unity3d.player.UnityPlayerActivity"
                  android:theme="@style/UnityThemeSelector"
+                  android:exported="true"
                  >

外部アプリから呼び出しを、NGとする場合は、android:exported="false"とすればよい。

参考:https://xrdnk.hateblo.jp/entry/2021/11/05/115104