質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

解決済

1回答

1850閲覧

[Unity]Unityに自作Androidライブラリのaarを取り込んでビルドするとBuild failureが出ます

drednote

総合スコア336

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2022/06/17 05:50

編集2022/06/17 06:00

UnityもAndroidも初心者なので、変なことを書いているかもしれませんがご了承願います。

Unityのプロジェクトに自作の、Android Studioで作成したaarファイルを組み込み、ビルドしたところ
Unityのエラー表示
このようなエラーが出ます。
Android Studioでビルドした際には特に何もエラーなど出ていなかったので、問題無いと思っていたのですがこれはやはりaarの作成手順?か何かがおかしいのでしょうか?
(恐らくJavaコード自体にエラーがあるならAndroid Studio側でエラーが出ると思うので、Javaコードに間違いは無いと思っています)

正直、何をどこから調べればいいのかも分からず途方に暮れています。
ググってみたところ、Keyが自分の物じゃないからエラーが出るんだ的な事が書かれているフォーラム等もあったのですが、そもそもapkじゃないaarにもKeyなどあるのでしょうか?

何か追加情報が恐らく必要だと思うのですが、何を貼れば良いのかすらよく分からないのでこの時点で質問出させて頂きます。
すみませんが指示をお願いします。

補足情報:
Unity側コンソールメッセージですが、貼ると凄まじく長いので躊躇しています。上の方だけ貼りますと
CommandInvokationFailure: Gradle build failed.
D:\Applications\Unity\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Applications\Unity\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[

FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ':launcher:processReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed

C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: style attribute 'attr/colorPrimary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorPrimary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: style attribute 'attr/colorPrimaryVariant (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorPrimaryVariant)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: style attribute 'attr/colorOnPrimary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorOnPrimary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: style attribute 'attr/colorSecondary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorSecondary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: style attribute 'attr/colorSecondaryVariant (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorSecondaryVariant)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: style attribute 'attr/colorOnSecondary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorOnSecondary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values\values.xml:11:5-23:13: AAPT: error: resource attr/colorPrimaryVariant (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorPrimaryVariant) not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: style attribute 'attr/colorPrimary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorPrimary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: style attribute 'attr/colorPrimaryVariant (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorPrimaryVariant)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: style attribute 'attr/colorOnPrimary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorOnPrimary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: style attribute 'attr/colorSecondary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorSecondary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: style attribute 'attr/colorSecondaryVariant (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorSecondaryVariant)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: style attribute 'attr/colorOnSecondary (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorOnSecondary)' not found. C:\Users\takuma\.gradle\caches\transforms-2\files-2.1\7c46687744f6f7a54e3515acf7918fca\unityeightbridge-debug\res\values-night-v8\values-night-v8.xml:3:5-15:13: AAPT: error: resource attr/colorPrimaryVariant (aka com.DefaultCompany.com.unity.template.mobile2D:attr/colorPrimaryVariant) not found.
  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

となっています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

Android StudioでAndroid Libraryを作成した時にもデフォルトでvalues/themesにxmlが2つ出来るようなのですが、
どうやらstyle.xmlが無いのにこのテーマファイルの中身があるとUnityでのgradleビルド時にエラーが出るようでした。
とりあえず、ファイルを消しても良いのかどうかわからなかったので、中身のxmlの部分を消して対応したところ、エラーは出なくなりました

投稿2022/06/17 07:13

drednote

総合スコア336

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問