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

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

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

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

Q&A

解決済

3回答

1080閲覧

[Unity] AdMob 広告をAndroidに実装できない。

nekoninzya839

総合スコア8

Unity

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

0グッド

1クリップ

投稿2018/01/02 03:17

Unity初心者です。
Unityを使って、AdMob広告を表示させたいのですが、できなくて困っています...

http://it-happens.info/unity-admob/の記事を参考に進めていったのですが、Assetの「Play Services Resolver」→「Android Resolver」→「Resolve Client jars」でjavaファイルを作成しようとしたところ、「Resolve Client jars」が見当たりませんでした。
そこで、https://matatabisoft.com/274/の記事を参考にしたのですが、「Force Resolve」を押すとエラーになり、<Your application will not run, see the log for details.>と表示されました。
Editor.logを確認したところ、下記のように書かれておりました。

私自身パソコン自体がそこまで詳しくなく、ログもまともに読めません...

環境変数の「JAVA_HOME」の設定も確認を行いましたが、問題はなさそうに見えました。

UnityのバージョンはUnity 5.2.2f1、Android studioは2.3.3、OSはwindowsVistaです。

どなたかご教授いただければと思っております。
よろしくお願いいたします。

以下Editor.logの内容です。

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.011165 seconds (Nothing changed)
Gradle failed to fetch dependencies.

Failed to run 'C:\Users\syu wada\Documents\Unity\Bound Ball\Temp\PlayServicesResolverGradle\gradlew.bat -b "C:\Users\syu wada\Documents\Unity\Bound Ball\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --no-daemon "-PANDROID_HOME=C:/Android/sdk" "-PTARGET_DIR=C:\Users\syu wada\Documents\Unity\Bound Ball\Assets\Plugins\Android" "-PMAVEN_REPOS=https://maven.google.com" "-PPACKAGES_TO_COPY=com.google.android.gms:play-services-ads:11.6.0"'
stdout:

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_111

Please set the JAVA_HOME variable in your environment to match the

location of your Java installation.

stderr:

exit code: 1

UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorApplicationBindings.gen.cs:270)

(Filename: C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs Line: 270)

Resolution failed

Failed to fetch the following dependencies:
com.google.android.gms:play-services-ads:11.6.0

UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.ResolverVer1_1:LogMissingDependenciesError(List1) GooglePlayServices.<DoResolutionUnsafe>c__AnonStorey18:<>m__26(List1)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorApplicationBindings.gen.cs:270)

(Filename: C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs Line: 270)

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.013943 seconds (Nothing changed)
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll' because we're compiling for Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll' because we're compiling for Editor
EditorHelper: Attempting to use MonoDevelop.

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

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

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

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

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

guest

回答の取得に失敗しました

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問