Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
3
Help us understand the problem. What is going on with this article?
@myzkyy

Unity で Android 向けに Google Play Services のライブラリを追加する。

More than 3 years have passed since last update.

Unity 5のプロジェクトに Growthbeat SDK for Unity を追加してAndroidで実行したら

Uncaught Exception: java.lang.NoClassDefFoundError; com.google.android.gms.iid.InstanceID

という実行時エラーが出たので google-play-services.jar を Assets/Plugins/Android 以下に配置したら今度は

warning: Ignoring InnerClasses attribute for an anonymous inner class (org.shaded.apache.commons.logging.LogFactory$3) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is not an inner class.

ということをビルド時に言われてしまったので、Google Play Servicesへの依存を追加する (Unity) — Repro ドキュメント を参考に

~/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-gcm/x.x.x/play-services-gcm-x.x.x.aar ファイルを Assets/Plugins/Android/libs ディレクトリにコピーしてください

というわけで、 *.jar ではなく *.aar 形式のライブラリとして追加したらOKでした。

3
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
myzkyy
最近は TypeScript, React[ Native], Vue.js, Firebase あたりをメインに触っています(Qiita で記事を書いているとは言っていない)。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
3
Help us understand the problem. What is going on with this article?