2016-10-07 2 views
8

OK, donc depuis que j'ai construit avec succès, tout ce que j'ai fait est essayé d'ajouter Google Play Services à mon jeu, de here.Unity Android APK se bloque au démarrage

J'ai importé le paquet de l'unité, et configurer les jeux de Google google pour Android dans la fenêtre de configuration pertinente.

J'ai essayé de construire à ce stade, mais j'ai été incapable de recevoir une erreur étrange lors de la construction de fichiers dex signifiant qu'il y a un conflit entre les fichiers AAR. Je l'ai réduit à être provoqué par les deux actifs/plugins/android/play-services-base-9.0.2 et assets/plugins/android/play-services-basement-9.0.2.

J'ai décoché les deux étant construit pour Android pour avoir la conversion à des trucs d'erreur dex disparaissent. J'ai supposé que ce serait OK.

je puis poussé l'application sur Google Play, (environnement alpha) avec un petit script de contrôleur pour Google Play pour vous connecter au démarrage():

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; 
    }); 
} 

Cependant l'unité semble être écraser avant d'ouvrir le premier scène. Il plante tout de suite, au démarrage. Le truc de logcat peut être vu here.

Le problème semble se produire autour de la ligne 842:

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... 

Je ne sais pas comment résoudre ce problème?

:: Informations additionnelles ::

J'ai roulé à un point où j'ai le paquet d'unité importée dans l'unité, mais je ne l'ai pas encore configuré, lui donnant mon xml contenant les ressources . Il donne un NullReferenceException dans l'éditeur à ce moment:

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[]) 

La ligne il fait référence est:

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

Cependant juste après ce NullReferenceException, je vois le resolver étant enregistré dans les journaux. Tels que:

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[]) 

etc.

Maintenant, je peux construire ce APK et l'exécuter sur mon beau téléphone, pas de problème. (De toute évidence, les services de jeu google play ne feront pas grand chose, car ils ne sont pas configurés).

Donc, je vais à la fenêtre >> Google Play Jeux >> Configuration >> Android et ici, je colle mes ressources XML. Je donne une place et un nom au fichier C# des ressources, et cliquez sur le programme d'installation.

Je vois la dépendance Jar suivantes options de conflit:

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? 

J'ai essayé de garder à appuyer tous ces éléments ainsi que OK, les deux actions finissent par provoquer un conflit avec mes Aars.

Je viens d'essayer à nouveau, cette fois en appuyant sur OK à tous, et j'ai essayé de construire à nouveau après avoir fait cela seulement depuis ma dernière version réussie.Alors que la conversion des bocaux en format dex, il ne l'accumulation donne l'erreur suivante:

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> 

Comme mentionné précédemment, je peux empêcher que cela se produise en plaçant mon jeu-services de base et les fichiers play-services sous-sol et les décocher pour être construit pour Android. Lorsque je fais cela, l'APK se construit, mais l'application va se bloquer dès son ouverture.

+0

Pourriez-vous lister l'erreur de conflit aar? ce serait utile. – JeanLuc

+0

Ajouté autant d'informations supplémentaires que je pouvais penser - J'espère que cela aide :) – pingu2k4

+0

Si vous avez éclipse, utilisez simplement logcat pour voir les erreurs sur le lancement de l'application. – Kenshin

Répondre

0

J'ai fait face au même problème l'année dernière sur mon projet de jeu Android. J'ai mis à jour le référentiel d'assistance Android, la bibliothèque d'assistance Android, les services Google Play, le référentiel Google, la bibliothèque de facturation Google, l'API Android 6.0, puis le problème a été résolu. Je ne sais toujours pas quelle est la source du problème mais, j'ai résolu le problème de cette façon dans mon projet. J'espère que cela fonctionne pour vous aussi.

0

eu le même problème avec mon projet d'unité un certain temps. Était une classe support-v4 en double. Il est apparu qu'il était préférable d'importer le plugin play goggle dans un projet vide (faire une build de test).

Ensuite, supprimez complètement le plug-in google play et tous les fichiers des dossiers Extensions, Editor et Plugins et réimportez à partir du projet vide. Désolé je ne peux pas clarifier plus loin n'ont plus accès à mes fichiers de projet.