2016-10-07 12 views
8

OK, od czasu, gdy pomyślnie zbudowałem, wszystko, co zrobiłem, to próba dodania usług Google Play do mojej gry, od here.Jednolitość pakietu APK aplikacji Android uległa awarii podczas uruchamiania

Zaimportowałem pakiet jedności i skonfigurowałem gry Google Play dla Androida w odpowiednim oknie konfiguracji.

Próbowałem budować w tym momencie, jednak nie byłem w stanie, otrzymałem ten dziwny błąd podczas budowania plików dex oznaczających konflikt między plikami aar. Zawęziłem go do powodu, że są spowodowane zarówno przez zasoby/wtyczki/android/play-services-base-9.0.2, jak i aktywa/wtyczki/android/play-services-basement-9.0.2.

Usunięto zaznaczenie, że oba te elementy są budowane na Androida, aby konwersja na błędy błędów zniknęła. Zakładałem, że to będzie w porządku.

Potem pchnął aplikację na Google Play (środowisko alfa) wraz z małą skryptu kontroler dla Google Play, aby zalogować się na start():

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

Jednak wydaje Unity być upaść przed otwarciem pierwszego scena. Rozbija się od razu po uruchomieniu. Logcat rzeczy można zobaczyć here.

Problem wydaje się występować wokół linii 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... 

nie mam pojęcia jak to naprawić?

:: Dodatkowe informacje ::

Więc ja przywracana do punktu, gdzie mam pakiet jedność importowane do jedności, ale nie skonfigurowano go jeszcze, nadając mu mój XML zawierający zasoby . To daje NullReferenceException w edytorze w tym momencie:

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

Linia odwołuje się:

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

Jednak zaraz po tym NullReferenceException, widzę rozpoznawania nazw rejestrowanych w dziennikach. Takich jak:

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

itp

Teraz mogę zbudować ten APK i uruchomić go na moim telefonie porządku, bez problemów. (Oczywiście usługi Google Play Game niewiele zdziałają, ponieważ nie są skonfigurowane).

Idę do Window >> Gry Google Play >> Setup >> Android i tutaj wklejam zasoby XML. Podaję miejsce i nazwę pliku C# zasobów i klikam Setup.

widzę następujące opcje Conflict Jar Zależność:

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? 

Próbowałem naciskając zachować do nich wszystkich, jak również OK, oba działania kończą się przyczyną konfliktu z moich rocznych sprawozdaniach z działalności.

Po prostu spróbowałem ponownie, tym razem naciskając OK na wszystkich z nich i próbowałem ponownie zbudować, robiąc to tylko od czasu mojej ostatniej udanej kompilacji.Podczas konwersji słoiki do dex formatu, to nie kompilacji daje następujący błąd:

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> 

Jak wspomniano wcześniej, mogę temu zapobiec poprzez umieszczenie mojej sztuce-Services bazy i plików play-services-piwnicy i odznaczając je do zbudowania dla Androida. Kiedy to zrobię, APK buduje, jednak aplikacja ulegnie awarii zaraz po jej otwarciu.

+0

Czy mógłbyś wymienić błąd konfliktu AAR? to byłoby pomocne. – JeanLuc

+0

Dodałem tyle dodatkowych informacji, ile mogłem wymyślić - Mam nadzieję, że to pomaga :) – pingu2k4

+0

Jeśli masz zaćmienie, po prostu użyj logcat, aby zobaczyć błędy podczas uruchamiania aplikacji. – Kenshin

Odpowiedz

0

W zeszłym roku stanąłem wobec tego samego problemu w moim projekcie gry na Androida. Zaktualizowałem Repozytorium pomocy technicznej Androida, bibliotekę pomocy Androida, usługi Google Play, repozytorium Google, bibliotekę rozliczeniową Google, Androida API 6.0, a następnie problem został rozwiązany. Wciąż nie wiem, co jest źródłem problemu, ale rozwiązałem ten problem w ten sposób w moim projekcie. Mam nadzieję, że to działa również dla ciebie.

0

miał ten sam problem z moim projektem jedności jakiś czas temu. Było duplikatem klasy wsparcia-v4. Wyobraźmy sobie, że najlepiej jest zaimportować wtyczkę Goggle Play do pustego projektu (Wykonaj testową kompilację).

Następnie należy całkowicie usunąć wtyczkę Google Play i wszystkie pliki z folderów rozszerzeń, edytorów i wtyczek i ponownie zaimportować z pustego projektu. Niestety, nie mogę teraz wyjaśnić, nie mam już dostępu do moich plików projektu.

Powiązane problemy