facebook twitter hatena line email

「Unity/多言語化/Androidのアプリ名」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(Assets/Plugins/Android/res was removedエラーが出る問題)
(Assets/Plugins/Android/res was removedエラーが出る問題)
 
(同じ利用者による、間の6版が非表示)
行12: 行12:
 
  Providing Android resources in Assets/Plugins/Android/res was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.
 
  Providing Android resources in Assets/Plugins/Android/res was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.
  
#res内のmetaを削除して、
+
Unity2021.3LTSからこのようなエラーが出るっぽい。
#resをzip化して、res.arrへリネームしたが、
+
  
Failed to transform res-.aar (:res:) to match attributes {artifactType=android-classes-jar,
+
====対策方法====
 +
#Assets/Plugins/Androidの下にres.androidlibを作る
 +
#以下をres.androidlibの下に作る
  
エラーになったので、未解決・・
+
*AndroidManifest.xml
 +
*project.properties
 +
*res
 +
 
 +
AndroidManifest.xml
 +
<pre>
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 +
          package="custom.android.res"
 +
          android:versionCode="1"
 +
          android:versionName="1.0">
 +
</manifest>
 +
</pre>
 +
project.properties
 +
<pre>
 +
target=android-9
 +
android.library=true
 +
</pre>
 +
 
 +
Assets/Plugins/Android/res.androidlib/res/values-ja/strings.xml
 +
<pre>
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<resources>
 +
    <string name="app_name">タイトル1</string>
 +
</resources>
 +
</pre>
 +
 
 +
これで、アプリ名を日本語にできた。
 +
 
 +
参考:https://kingmo.jp/kumonos/unity-2021lts-res-folda-build-error/

2023年10月29日 (日) 14:37時点における最新版

Androidのアプリタイトルの多言語化対応方法

Assets/Plugins/Android/res/values-ja/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">タイトル1</string>
</resources>

Assets/Plugins/Android/res was removedエラーが出る問題

エラー詳細

Providing Android resources in Assets/Plugins/Android/res was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.

Unity2021.3LTSからこのようなエラーが出るっぽい。

対策方法

  1. Assets/Plugins/Androidの下にres.androidlibを作る
  2. 以下をres.androidlibの下に作る
  • AndroidManifest.xml
  • project.properties
  • res

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="custom.android.res"
          android:versionCode="1"
          android:versionName="1.0">
</manifest>

project.properties

target=android-9
android.library=true

Assets/Plugins/Android/res.androidlib/res/values-ja/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">タイトル1</string>
</resources>

これで、アプリ名を日本語にできた。

参考:https://kingmo.jp/kumonos/unity-2021lts-res-folda-build-error/