2016-10-07 7 views
8

最後に正常に構築されたので、私が行ったことはすべて、ゲームにGoogle Playサービスを追加しようとしたことです。hereから。ユニティAndroid APKが起動時にクラッシュする

私は、ユニティパッケージをインポートし、関連するセットアップウィンドウでアンドロイド用のGoogle Playゲームを設定しました。

私はこの時点でビルドを試みましたが、aarファイル間に競合が存在することを示すdexファイルを作成している間に、その奇妙なエラーを受け取ることができませんでした。私はそれを、資産/プラグイン/アンドロイド/プレイ - サービス - ベース - 9.0.2とアセット/プラグイン/アンドロイド/プレイ - サービス - ベース - 9.0.2の両方によって引き起こされるように絞り込んだ。

デベロッパーのエラーへの変換がなくなるために、これらの両方がアンドロイドに組み込まれていないことを確認しました。私はこれがOKだろうと思った。

Googleは(起動時にログインする再生のために、私はそれから)小さなコントローラスクリプトと一緒に(アルファ環境)、Google Playの上にアプリをプッシュ:

void Awake() 
{ 
    // recommended for debugging: 
    PlayGamesPlatform.DebugLogEnabled = true; 
    // Activate the Google Play Games platform 
    PlayGamesPlatform.Activate(); 
} 

void Start() 
{ 
    Login(); 
} 

void Login() 
{ 
    Social.localUser.Authenticate((bool success) => { 
     LoggedIn = success; 
    }); 
} 

しかしUnityが最初に開く前にクラッシュするように見えますシーン。起動時にすぐにクラッシュしています。 logcatのものはhereで見ることができます。私はこの問題を解決する方法が分からない

10-07 06:03:06.282: E/AndroidRuntime(9551): FATAL EXCEPTION: main 
10-07 06:03:06.298: W/ActivityManager(771): Force finishing activity 1 com.PINGUAPPS.TEMPLATE/com.unity3d.player.UnityPlayerNativeActivity 
10-07 06:03:06.339: W/ActivityManager(771): Force finishing activity 2 com.google.android.apps.mtaas.backdrop/.BackdropActivity 
10-07 06:03:06.402: D/Atlas(771): Validating map... 

問題はライン842の周りに発生するように見えますか?

::追加情報::

だから私は、私はUnityにインポートした統一パッケージを持っているポイントにロールバックしてきたが、私はそれをリソースを含む私のXMLを与え、それをまだ設定していません。この時点では、エディタでとNullReferenceExceptionを与えている:

NullReferenceException: Object reference not set to an instance of an object 
GooglePlayServices.PlayServicesResolver.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs:104) 
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. 
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) 
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) 
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27) 
UnityEditor.AssetDatabase:Refresh() 
GooglePlayGames.Editor.GPGSUpgrader:.cctor() (at Assets/GooglePlayGames/Editor/GPGSUpgrader.cs:107) 
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[]) 

それが参照する行は次のとおりです。

if (!Resolver.ShouldAutoResolve(importedAssets, deletedAssets, 
       movedAssets, movedFromAssetPaths)) 

しかし右これとNullReferenceExceptionの後、私はログに登録されているリゾルバを参照してください。以下のような:

Registering resolver version 1.2.0 
UnityEngine.Debug:Log(Object) 
GooglePlayServices.ResolverVer1_2:.cctor() (at Assets/PlayServicesResolver/Editor/ResolverVer1_2.cs:34) 
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[]) 

など今

、私はこのAPKを構築し、自分の携帯電話の罰金、問題なしで実行することができます。 (明らかに、Google Playゲームサービスは設定されていないため、あまり効果がありません)。

だから、私はウィンドウ>> Google Playゲーム>>セットアップ>> Android に行き、ここで私のリソースXMLを貼り付けます。 リソースC#ファイルの場所と名前を付け、セットアップを押します。

私は、次のJAR依存関係紛争のオプションを参照してください。

Remove or replace play-services-ads version 9.0.2 with version 9.6.1? 
Remove or replace support-v4 version 23.1.1 with version 24.0.0? 
Remove or replace play-services-gcm version 9.0.2 with version 9.6.1? 
Remove or replace play-services-location version 9.0.2 with version 9.6.1? 
Remove or replace play-services-base version 9.0.2 with version 9.6.1? 
Remove or replace play-services-basement version 9.0.2 with version 9.6.1? 
Remove or replace support-annotations version 23.1.1 with version 23.4.0? 
Remove or replace play-services-iid version 9.0.2 with version 9.6.1? 
Remove or replace play-services-tasks version 9.0.2 with version 9.6.1? 

私はこれらのすべてに保つだけでなく、[OK]を押すと、両方のアクションは、私のAARSとの競合の原因に終わる試してみました。

私はもう一度試してみましたが、今回はOKを押して、最後に成功したビルド以降にしかビルドしようとしませんでした。DEX形式にjarファイルを変換する一方で、それは次のエラーを与えるビルド失敗:前述したように

CommandInvokationFailure: Unable to convert classes into dex format. 
C:\Program Files (x86)\Java\jdk1.7.0_55\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Users/PINGU/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" - 

stderr[ 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.a) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.banners.BannerSize$1) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.banners.b) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.banners.d) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.banners.a) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.banners.c) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.interstitials.a.b) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.interstitials.a.c) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.ofw.a) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.e) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.f) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.g) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.h) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.d) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.i) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.j) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.m) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.n) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.a.o) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.b) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.c) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.e) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.h) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.f) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.g) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.k) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.i) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.j) 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. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(com.fyber.ads.videos.l) that doesn't come with<message truncated> 

を、私は私のプレイ・サービス・ベースを配置することによってこれを防ぐとファイル・サービス・地下遊ぶことができるとアンドロイドのためにそれらのチェックを外す。これを行うと、APKが構築されますが、アプリが開かれるとすぐにクラッシュします。

+0

aar競合エラーをリストできますか?それは助けになるだろう。 – JeanLuc

+0

私が考えることができるように多くの追加情報を追加しました - ホープが助けてくれるでしょう:) – pingu2k4

+0

eclipseをお持ちの場合は、logcatを使ってアプリケーションを起動する際のエラーを確認してください。 – Kenshin

答えて

0

去年の私のAndroidゲームプロジェクトで同じ問題が発生しました。 Androidサポートレポジトリ、Androidサポートライブラリ、Google Playサービス、Googleリポジトリ、Google Billing Library、Android API 6.0をアップデートして問題を解決しました。私はまだ問題の原因がわからないが、私はこの方法で問題を解決した。私もそれがあなたのために働くことを願っています

0

は、しばらく前に私の統一プロジェクトと同じ問題を持っていました。重複したサポート-v4クラスでした。ゴーグルプレイプラグインを空のプロジェクトにインポートするのが最善であることが分かった(テストビルドを行う)。

その後、Google Playプラグインと拡張機能、エディタ、プラグインの各フォルダからすべてのファイルを完全に削除し、空のプロジェクトから再度インポートします。申し訳ありませんが、プロジェクトファイルへのアクセス権がなくなったことを明確にすることはできません。

関連する問題