- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
好的,自从我上次成功构建以来,我所做的就是尝试将 Google Play 服务添加到我的游戏中,来自 here .
我导入了 unity 包,并在相关设置窗口中设置了 google play games for android。
此时我尝试构建,但是我无法构建 dex 文件时收到那个奇怪的错误,表示 aar 文件之间存在冲突。我将其缩小为由 assets/plugins/android/play-services-base-9.0.2 和 assets/plugins/android/play-services-basement-9.0.2 引起。
我取消选中为 android 构建的这两个,以便将转换为 dex 错误的东西消失。我以为这样就可以了。
然后我将应用程序推送到 Google Play(alpha 环境)以及一个用于 Google Play 的小型 Controller 脚本以在 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;
});
}
但是,Unity 在打开第一个场景之前似乎崩溃了。它在启动时立即崩溃。 logcat的东西可以看here .
问题似乎出现在第 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...
我不知道如何解决这个问题?
::附加信息::
所以我回退到将统一包导入 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?
我已经尝试按 keep 到所有这些以及 OK,这两个操作最终都会导致与我的 aars 发生冲突。
我又试了一次,这次对所有这些都按了确定,并尝试再次构建,这是我上次成功构建后才这样做的。在将 jars 转换为 dex 格式时,构建失败并出现以下错误:
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>
如前所述,我可以通过找到我的 play-services-base 和 play-services-basement 文件并取消选中它们为 android 构建来防止这种情况发生。当我这样做时,APK 会构建,但是应用程序会在打开后立即崩溃。
最佳答案
我去年在我的 Android 游戏项目中遇到了同样的问题。我更新了 Android Support Repository ,Android Support Library , Google Play Services , Google Repository , Google Billing Library , Android API 6.0 ,然后问题就解决了。我仍然不知道问题的根源是什么,但是,我在我的项目中用这种方式解决了问题。我希望它也对你有用。
关于android - Unity Android APK 在启动时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39920188/
我已经为我的 Android 应用设置了 Google Play 测试版程序。想象一下以下场景: 我将 apk1 作为 versionCode 1 的测试版发布 Beta 用户安装此 Beta 版本
我需要在 android studio 中生成一个未签名的 APK。我看到了其他一些关于此的问题。 Export unsigned apk from a Gradle Project in Andro
我想知道更新是如何进行的?它如何更新特定文件仅更改?我的意思是在更新期间,整个 apk 是否再次安装或仅特定文件更改?它是如何工作的?我只想知道 android market 如何在没有用户提示的情况
如何在使用新 apk 的情况下升级 android 应用程序而不丢失以前的 apk 数据? 最佳答案 有一个versionCode AndroidManifest.xml 中的元素。这是一个整数,每个
我看到 Android 在输出文件夹中同时创建了一个“普通”APK 和一个 androidTest APK? 即 app-dev-debug.apk app-dev-debug-androidTest
Upload failed You uploaded an APK that is signed with a different certificate to your previous APKs.
对我来说,这发生在所有项目中。当我从 Android Studio 生成签名的 apk 时,我收到以下正确消息: 问题:在此之后,当我实际上并没有生成签名的 apk 时,我继续为项目发生的每个构建收到
我需要在 Windows 上反编译 & 重新编译一个 apk... 我正在关注此链接 Reverse Engineer APK 问题是我找不到发出请求的文件(请参阅上面的链接)“找到发出请求的文件 g
我寻找一种方法来制作一个可以更改我的第一个 apk 的默认图标的 apk。例如 ADW Launcher。 我该怎么做?也许是一种获取另一个 apk 的绘图的方法? 感谢您的帮助。 最佳答案 我想您正
我正在开发一个基于图像的应用程序,具有以下属性: 手机版本的 apk 大小(不含图像)约为 15MB,平板电脑版本约为 25MB。 图像总大小约为 30MB。 该应用程序将以测试版状态发布,可能会频繁
假设在网站上我有一个 apk 和网站的在线 JSON 数据,现在依赖于那个 apk 我想用新的 JSON 数据重新生成新的 apk 文件,还需要Manifest文件中的应用图标也要动态变化,包名也要动
今天我注意到当我在 Eclipse 中导出我的应用程序时,我得到了一个无扩展名的文件。我过去没有注意到这一点,所以我将此文件作为我的应用程序的 APK 文件上传到 Google Play。当我今天看到
我有一个同时适用于手机/平板电脑和电视的应用程序。当我在电视上使用 leanback 时,这个项目由 3 个模块组成。第一个(库)包含电视和移动/平板电脑模块通用的所有类,然后我有电视和移动/平板电脑
我制作了一个仅包含微调器和按钮的基本应用程序,但它的 Release模式大小为 1.4 MB,我认为这太大了,因为也有很多低于 200kB 的好应用程序可用 所以我在 gradle 文件中尝试了 b
我的移动开发人员已向我提供了一个 APK 文件,我需要将其上传到商店。它说,你需要在 Release模式下编译它。有没有一种方法可以让我对 apk 执行此操作,使其进入 Release模式并使用 ke
我在里面制作了一个 android 应用程序,我已经在“res/raw”文件夹中放置了一个 apk 文件,现在我在安装我的 apk 时想要什么,raw 文件夹中的 apk 也会安装,而无需再次单击安装
我有一个带有未签名包的 android 应用程序,每当我尝试安装此 apk 时,都会出现以下错误消息:Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]。 现
我开发的 Android 应用由不同的人群进行测试。 我们使用 Google Play Beta 方案。 同一组测试人员也提供生产支持。完成测试后,他们需要将设备恢复为生产应用,以便反射(reflec
我有一个已发布的应用程序。该应用程序使用 Google 的许可检查,因此为了测试该应用程序的新版本(使用测试帐户),必须在开发者控制台中上传 APK: 对于尚未上传到 Google Play 的应用程
我正在制作一个应用程序,我想在其中调用其他一些 apk(未预装),它们存在于我手机的 SD 卡中,我希望在安装主应用程序时安装它们。这可能吗?以及如何? 最佳答案 您可以使用以下 Intent 请求
我是一名优秀的程序员,十分优秀!