Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用最新BaseGameUtils的Google Play Game Services LibGDX项目设置_Java_Android_Eclipse_Libgdx_Google Play Services - Fatal编程技术网

Java 使用最新BaseGameUtils的Google Play Game Services LibGDX项目设置

Java 使用最新BaseGameUtils的Google Play Game Services LibGDX项目设置,java,android,eclipse,libgdx,google-play-services,Java,Android,Eclipse,Libgdx,Google Play Services,这是我的第一篇文章,但我无法独自或通过谷歌搜索解决这个问题。任何见解都将得到认真考虑,因此非常感谢 我正在使用LibGDX框架,我的目标是通过谷歌Play游戏服务获得工作成果和排行榜,并通过AdMob发布广告 我能够使用Invader360的Google Play Game Services教程设置功能性成就/排行榜 AdMob调用清单条目的早期步骤导致@integer不可用的错误。最新版本的“google-play-services_lib”修复了这一问题,但揭示了BaseGameUtils中

这是我的第一篇文章,但我无法独自或通过谷歌搜索解决这个问题。任何见解都将得到认真考虑,因此非常感谢

我正在使用LibGDX框架,我的目标是通过谷歌Play游戏服务获得工作成果和排行榜,并通过AdMob发布广告

我能够使用Invader360的Google Play Game Services教程设置功能性成就/排行榜

AdMob调用清单条目的早期步骤导致@integer不可用的错误。最新版本的“google-play-services_lib”修复了这一问题,但揭示了BaseGameUtils中的三个类被贬值。然后,我从主要来源获取了BaseGameUtils库的最新版本。(我会添加更多链接,但我的声誉不够高)

有趣的是,当前版本的结构与上一版本不同。在导入Eclipse之前,我临时将“main”文件夹的标题改为“BaseGameUtils”。然后,我将这三个类从“java”文件夹移动到“src”文件夹中。这导致了一个FragmentActivity错误,因此我创建了一个“libs”文件夹,并将其放入android-support-v4.jar中以缓解此问题

当前:
-BaseGameUtils已选中“Is库”并添加“google-play-services_库”作为参考。
-google-play-services_lib已选中“是库”
-android游戏项目引用了这两个库

我转向MainActivity,使用以下来源将内容转换为最新方式:

并向下滚动到“在没有BaseGameActivity的情况下使用GameHelper”

按原样,应用程序跳过了启动屏幕,并在崩溃之前显示了启动屏幕的一瞥。这是日志:

04-17 02:43:28.994: D/dalvikvm(21249): Trying to load lib /data/app-lib/com.crtgames.cavebat-2/libgdx.so 0x424b0c00
04-17 02:43:29.004: D/dalvikvm(21249): Added shared lib /data/app-lib/com.crtgames.cavebat-2/libgdx.so 0x424b0c00
04-17 02:43:29.004: D/dalvikvm(21249): No JNI_OnLoad found in /data/app-lib/com.crtgames.cavebat-2/libgdx.so 0x424b0c00, skipping init
04-17 02:43:29.014: D/libEGL(21249): loaded /system/lib/egl/libEGL_adreno200.so
04-17 02:43:29.014: D/libEGL(21249): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
04-17 02:43:29.014: D/libEGL(21249): loaded /system/lib/egl/libGLESv2_adreno200.so
04-17 02:43:29.024: I/Adreno200-EGL(21249): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build:  (CL3544079)
04-17 02:43:29.024: I/Adreno200-EGL(21249): Build Date: 03/28/13 Thu
04-17 02:43:29.024: I/Adreno200-EGL(21249): Local Branch: adreno_20130328
04-17 02:43:29.024: I/Adreno200-EGL(21249): Remote Branch: 
04-17 02:43:29.024: I/Adreno200-EGL(21249): Local Patches: 
04-17 02:43:29.024: I/Adreno200-EGL(21249): Reconstruct Branch: 
04-17 02:43:29.094: D/dalvikvm(21249): GC_FOR_ALLOC freed 210K, 7% free 16805K/18028K, paused 19ms, total 19ms
04-17 02:43:29.104: I/dalvikvm-heap(21249): Grow heap (frag case) to 19.648MB for 2359312-byte allocation
04-17 02:43:29.134: D/dalvikvm(21249): GC_FOR_ALLOC freed <1K, 7% free 19108K/20336K, paused 24ms, total 24ms
04-17 02:43:29.144: D/dalvikvm(21249): GC_CONCURRENT freed <1K, 7% free 19111K/20336K, paused 2ms+1ms, total 14ms
04-17 02:43:29.144: D/GameHelper(21249): GameHelper: Debug log enabled.
04-17 02:43:29.144: D/GameHelper(21249): GameHelper: Setup: requested clients: 7
04-17 02:43:29.154: W/PopupManager(21249): 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.
04-17 02:43:29.154: D/GameHelper(21249): GameHelper: onStart
04-17 02:43:29.154: D/GameHelper(21249): GameHelper: Connecting client.
04-17 02:43:29.154: W/ResourceType(21249): Failure getting entry for 0x7f06000d (t=5 e=13) in package 0 (error -75)
04-17 02:43:29.154: E/GooglePlayServicesUtil(21249): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-17 02:43:29.174: W/ResourceType(21249): Failure getting entry for 0x7f06000d (t=5 e=13) in package 0 (error -75)
04-17 02:43:29.174: E/GooglePlayServicesUtil(21249): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-17 02:43:29.184: W/ResourceType(21249): Failure getting entry for 0x7f06000d (t=5 e=13) in package 0 (error -75)
04-17 02:43:29.184: E/GooglePlayServicesUtil(21249): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-17 02:43:29.194: I/AndroidInput(21249): sensor listener setup
04-17 02:43:29.234: I/Adreno200-EGL(21249): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build:  (CL3544079)
04-17 02:43:29.234: I/Adreno200-EGL(21249): Build Date: 03/28/13 Thu
04-17 02:43:29.234: I/Adreno200-EGL(21249): Local Branch: adreno_20130328
04-17 02:43:29.234: I/Adreno200-EGL(21249): Remote Branch: 
04-17 02:43:29.234: I/Adreno200-EGL(21249): Local Patches: 
04-17 02:43:29.234: I/Adreno200-EGL(21249): Reconstruct Branch: 
04-17 02:43:29.264: D/OpenGLRenderer(21249): Enabling debug mode 0
04-17 02:43:29.274: W/GL2JNIView(21249): creating OpenGL ES 2.0 context
04-17 02:43:29.284: D/AndroidRuntime(21249): Shutting down VM
04-17 02:43:29.284: W/dalvikvm(21249): threadid=1: thread exiting with uncaught exception (group=0x41355ac8)
04-17 02:43:29.284: E/AndroidRuntime(21249): FATAL EXCEPTION: main
04-17 02:43:29.284: E/AndroidRuntime(21249): java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
04-17 02:43:29.284: E/AndroidRuntime(21249):    at com.google.android.gms.internal.eh$h.b(Unknown Source)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at com.google.android.gms.internal.eh$h.a(Unknown Source)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at com.google.android.gms.internal.eh$b.ec(Unknown Source)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at com.google.android.gms.internal.eh$a.handleMessage(Unknown Source)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at android.os.Looper.loop(Looper.java:137)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at android.app.ActivityThread.main(ActivityThread.java:5293)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at java.lang.reflect.Method.invokeNative(Native Method)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at java.lang.reflect.Method.invoke(Method.java:511)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
04-17 02:43:29.284: E/AndroidRuntime(21249):    at dalvik.system.NativeStart.main(Native Method)
04-17 02:43:29.304: D/dalvikvm(21249): Trying to load lib /data/app-lib/com.crtgames.cavebat-2/libgdx.so 0x424b0c00
04-17 02:43:29.304: D/dalvikvm(21249): Shared lib '/data/app-lib/com.crtgames.cavebat-2/libgdx.so' already loaded in same CL 0x424b0c00
04-17 02:43:29.304: I/GL2(21249): all initialized 2
04-17 02:43:29.304: I/AndroidGraphics(21249): OGL renderer: Adreno (TM) 320
04-17 02:43:29.304: I/AndroidGraphics(21249): OGL vendor: Qualcomm
04-17 02:43:29.304: I/AndroidGraphics(21249): OGL version: OpenGL ES 2.0 V@14.0 AU@  (CL@3544079)
04-17 02:43:29.304: I/AndroidGraphics(21249): OGL extensions:                     GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_labelGL_EXT_debug_markerGL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_image_external   GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_color_buffer_float    GL_EXT_color_buffer_half_float 
04-17 02:43:29.304: W/Adreno200-EGL(21249): <qeglDrvAPI_eglGetConfigAttrib:487>: EGL_BAD_ATTRIBUTE
04-17 02:43:29.304: W/Adreno200-EGL(21249): <qeglDrvAPI_eglGetConfigAttrib:487>: EGL_BAD_ATTRIBUTE
04-17 02:43:29.304: I/AndroidGraphics(21249): framebuffer: (5, 6, 5, 0)
04-17 02:43:29.304: I/AndroidGraphics(21249): depthbuffer: (16)
04-17 02:43:29.304: I/AndroidGraphics(21249): stencilbuffer: (0)
04-17 02:43:29.304: I/AndroidGraphics(21249): samples: (0)
04-17 02:43:29.304: I/AndroidGraphics(21249): coverage sampling: (false)
04-17 02:43:29.314: I/AndroidGraphics(21249): Managed meshes/app: { }
04-17 02:43:29.314: I/AndroidGraphics(21249): Managed textures/app: { }
04-17 02:43:29.314: I/AndroidGraphics(21249): Managed shaders/app: { }
04-17 02:43:29.314: I/AndroidGraphics(21249): Managed buffers/app: { }
04-17 02:43:31.026: V/MediaPlayer(21249): decode(53, 100761, 16502)
04-17 02:43:31.066: V/MediaPlayer(21249): decode(54, 117313, 10400)
04-17 02:43:31.096: V/MediaPlayer(21249): decode(55, 66517, 34194)
}


可能是生成路径或生命周期问题?另外,在评论onStart()、onStop()和onActivityResult()时,我的项目运行得非常好,直到我点击排行榜按钮,再次崩溃。什么都行

它似乎与google play服务有关。您应该在清单中的标记处添加元数据

<meta-data android:name="com.google.android.gms.games.APP_ID"
    android:value="@string/app_id" />


谢谢。我的清单包含这个元标记,以及:给出答案,因为我的问题与清单有关。我的一句话是错的,我在仔细检查Android开发时意识到了这一点website@SinanKozak I有此错误“未找到与给定名称匹配的资源(在'value'处,值为'@string/app_id')”。您有什么建议吗?@DinoVelić您是否向android gradle添加了播放服务?您是否解决了此问题?更改清单如何使其正确导入?当您试图将依赖项导入到项目中时,我总是惊讶于什么都不起作用。
<meta-data android:name="com.google.android.gms.games.APP_ID"
    android:value="@string/app_id" />