Google Play服务Unity3d插件

时间:2014-07-08 16:29:22

标签: unity3d google-play-services

我之前已经为Unity3d实现了Google Play服务插件,一切运行正常,我正在更改项目名称并更新开发者控制台,从测试项目转到实际游戏,当所有内容都破坏时。我知道应用程序ID需要匹配,我再次遵循所有指示,但似乎我做错了,无法找出问题所在。

Unity3d和Android SDK都已经更新,因为这个插件出来了,我也想验证它仍在工作,因为谷歌播放服务有几个陈![在这里输入图像描述] [1] ges。

当错误发生时,下面是我的logcat。截至目前,我将其限制为仅尝试登录,即应用程序关闭并失败。

--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
E/gpop.InstalledAppsGrid( 2351): Hidden list size 77
E/gpop.InstalledAppsGrid( 2351): Hidden list size 77
E/KeyMappingDownloader( 2351): No keymapping for com.DPGaming.Evolution
E/SQLiteDatabase( 2885): close() was never explicitly called on database '/data/data/com.google.android.gms/databases/metrics.db' 
E/SQLiteDatabase( 2885): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
E/SQLiteDatabase( 2885):    at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:779)
E/SQLiteDatabase( 2885):    at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:231)
E/SQLiteDatabase( 2885):    at fyc.d(SourceFile:96)
E/SQLiteDatabase( 2885):    at fyc.a(SourceFile:220)
E/SQLiteDatabase( 2885):    at com.google.android.gms.googlehelp.service.ClearHelpHistoryIntentService.onHandleIntent(SourceFile:47)
E/SQLiteDatabase( 2885):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/SQLiteDatabase( 2885):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/SQLiteDatabase( 2885):    at android.os.Looper.loop(Looper.java:137)
E/SQLiteDatabase( 2885):    at android.os.HandlerThread.run(HandlerThread.java:60)
E/System  ( 2885): Uncaught exception thrown by finalizer
E/System  ( 2885): java.lang.IllegalStateException: Don't have database lock!
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.verifyLockOwner(SQLiteDatabase.java:2090)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase$1.entryRemoved(SQLiteDatabase.java:2182)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase$1.entryRemoved(SQLiteDatabase.java:2178)
E/System  ( 2885):  at android.util.LruCache.trimToSize(LruCache.java:197)
E/System  ( 2885):  at android.util.LruCache.evictAll(LruCache.java:285)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.deallocCachedSqlStatements(SQLiteDatabase.java:2143)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.closeClosable(SQLiteDatabase.java:1126)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java:1914)
E/System  ( 2885):  at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)
E/System  ( 2885):  at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
E/System  ( 2885):  at java.lang.Thread.run(Thread.java:856)
E/SQLiteDatabase( 2885): close() was never explicitly called on database '/data/data/com.google.android.gms/databases/help_responses.db' 
E/SQLiteDatabase( 2885): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
E/SQLiteDatabase( 2885):    at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:779)
E/SQLiteDatabase( 2885):    at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:231)
E/SQLiteDatabase( 2885):    at fxy.c(SourceFile:122)
E/SQLiteDatabase( 2885):    at fxy.b(SourceFile:506)
E/SQLiteDatabase( 2885):    at com.google.android.gms.googlehelp.service.ClearHelpHistoryIntentService.onHandleIntent(SourceFile:48)
E/SQLiteDatabase( 2885):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/SQLiteDatabase( 2885):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/SQLiteDatabase( 2885):    at android.os.Looper.loop(Looper.java:137)
E/SQLiteDatabase( 2885):    at android.os.HandlerThread.run(HandlerThread.java:60)
E/System  ( 2885): Uncaught exception thrown by finalizer
E/System  ( 2885): java.lang.IllegalStateException: Don't have database lock!
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.verifyLockOwner(SQLiteDatabase.java:2090)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase$1.entryRemoved(SQLiteDatabase.java:2182)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase$1.entryRemoved(SQLiteDatabase.java:2178)
E/System  ( 2885):  at android.util.LruCache.trimToSize(LruCache.java:197)
E/System  ( 2885):  at android.util.LruCache.evictAll(LruCache.java:285)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.deallocCachedSqlStatements(SQLiteDatabase.java:2143)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.closeClosable(SQLiteDatabase.java:1126)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java:1914)
E/System  ( 2885):  at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)
E/System  ( 2885):  at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
E/System  ( 2885):  at java.lang.Thread.run(Thread.java:856)
E/SQLiteDatabase( 2885): close() was never explicitly called on database '/data/data/com.google.android.gms/databases/history_query.db' 
E/SQLiteDatabase( 2885): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
E/SQLiteDatabase( 2885):    at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:779)
E/SQLiteDatabase( 2885):    at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
E/SQLiteDatabase( 2885):    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
E/SQLiteDatabase( 2885):    at fzm.a(SourceFile:92)
E/SQLiteDatabase( 2885):    at com.google.android.gms.googlehelp.service.ClearHelpHistoryIntentService.onHandleIntent(SourceFile:49)
E/SQLiteDatabase( 2885):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/SQLiteDatabase( 2885):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/SQLiteDatabase( 2885):    at android.os.Looper.loop(Looper.java:137)
E/SQLiteDatabase( 2885):    at android.os.HandlerThread.run(HandlerThread.java:60)
E/System  ( 2885): Uncaught exception thrown by finalizer
E/System  ( 2885): java.lang.IllegalStateException: Don't have database lock!
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.verifyLockOwner(SQLiteDatabase.java:2090)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase$1.entryRemoved(SQLiteDatabase.java:2182)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase$1.entryRemoved(SQLiteDatabase.java:2178)
E/System  ( 2885):  at android.util.LruCache.trimToSize(LruCache.java:197)
E/System  ( 2885):  at android.util.LruCache.evictAll(LruCache.java:285)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.deallocCachedSqlStatements(SQLiteDatabase.java:2143)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.closeClosable(SQLiteDatabase.java:1126)
E/System  ( 2885):  at android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java:1914)
E/System  ( 2885):  at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)
E/System  ( 2885):  at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
E/System  ( 2885):  at java.lang.Thread.run(Thread.java:856)
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/Constants( 2351): Getting new oem
E/Constants( 2351): product.oem not found
E/Constants( 2351): Getting new oem
E/Constants( 2351): product.oem not found
E/Constants( 2351): Getting new oem
E/Constants( 2351): product.oem not found
E/Sensor-AccelerometerUI( 2377): java.io.IOException: Connection refused
E/PGA     ( 4346): :::::::: PgaUtilsEnumToStr: invalid e 0x30e2
E/dalvikvm( 4346): Could not find class 'org.onepf.oms.appstore.TStoreRequestCallback', referenced from method org.onepf.oms.appstore.TStoreBillingService.launchPurchaseFlow
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/NativeActivity( 4346): channel 'b321ddb0 com.DPGaming.Evolution/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal.  status=-11
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/NativeActivity( 4346): channel 'b321ddb0 com.DPGaming.Evolution/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal.  status=-11
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/NativeActivity( 4346): channel 'b321ddb0 com.DPGaming.Evolution/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal.  status=-11
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/NativeActivity( 4346): channel 'b321ddb0 com.DPGaming.Evolution/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal.  status=-11
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/NativeActivity( 4346): channel 'b321ddb0 com.DPGaming.Evolution/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal.  status=-11
E/InputDispatcher( 2155): Motion event has invalid pointer count 0; value must be between 1 and 16.
E/NativeActivity( 4346): channel 'b321ddb0 com.DPGaming.Evolution/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal.  status=-11
E/dalvikvm( 4346): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
E/dalvikvm( 4346): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
E/libEGL  ( 4346): call to OpenGL ES API with no current context (logged once per thread)

E/dalvikvm( 4409): Could not find class 'org.onepf.oms.appstore.TStoreRequestCallback', referenced from method org.onepf.oms.appstore.TStoreBillingService.launchPurchaseFlow 

另一个具有更多输出和调试功能的LogCat我找到了问题的区域,但我不知道从哪里开始修复它。以下日志发生在Social.localUser.Authenticate

之后
*******************************LOGCAT*************************
I/SystemUpdateService( 5243): cancelUpdate (empty URL)

W/System.err( 4501): Error: /data/data/libqemu_wl.user.txt: open failed: ENOENT (No such file or directory)

I/ActivityManager( 4501): package `com.android.providers.downloads` whitelisting status = false

I/dalvikvm( 5725): Could not find method android.view.View.getDisplay, referenced from method com.google.android.gms.games.internal.PopupManager$PopupManagerHCMR1.h

W/dalvikvm( 5725): VFY: unable to resolve virtual method 800: Landroid/view/View;.getDisplay ()Landroid/view/Display;

D/dalvikvm( 5725): VFY: replacing opcode 0x6e at 0x0009

I/dalvikvm( 5725): Could not find method android.view.ViewTreeObserver.removeOnGlobalLayoutListener, referenced from method com.google.android.gms.games.internal.PopupManager$PopupManagerHCMR1.g

W/dalvikvm( 5725): VFY: unable to resolve virtual method 845: Landroid/view/ViewTreeObserver;.removeOnGlobalLayoutListener (Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

D/dalvikvm( 5725): VFY: replacing opcode 0x6e at 0x0037

W/PopupManager( 5725): You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of the API. Use setViewForPopups() to set your content view.

2 个答案:

答案 0 :(得分:2)

好的所以我已经修复了导致它崩溃的问题,下面是我改变的内容:

第一步:创建全新项目并完成开发人员控制台,只发布一个简单的登录按钮。有用。我现在知道我的Unity3d,Android APK和开发者控制台程序都是正确的。

第二步:转到项目我正在努力工作并创建一个新场景,再次只添加一个登录按钮。有用。所以现在我的项目很好,与代码有关。

第三步:我注释掉了所有的代码和对象,然后慢慢地逐一添加......这很痛苦。但是我找到问题的根源,问题是当尝试从云加载时新玩家没有存储数据,因此返回的数据数据未初始化,我通过做一个if(data.length&gt)来解决这个问题。 ; 0)但是这会导致崩溃,所以一个简单的尝试和捕获,只是使用返回的数据,好像假设它的正确工作很好。

答案 1 :(得分:0)

您提到更改项目的名称,是否包含包名称?我建议看一下Android Manifest,以防活动经理试图调用错误的包/活动。