我正在尝试编写一个从其他库中获取功能的android库,问题本质上是一个应用程序计费库,我想将一个接口编写为一个单独的jar库,以包含在一个项目中
如果可能的话,我怎么能这样做?如果没有,我的选择是什么?我尝试在我的jar库中构建类,但是当我尝试从其他库调用函数时,我收到以下错误:
AndroidJavaException:java.lang.ExceptionInInitializerError
完整logcat:
--------- / dev / log / system的开头 --------- / dev / log / main D / Unity开头(14530):GL_OES_rgb8_rgba8 GL_OES_EGL_sync GL_OES_fbo_render_mipmap GL_NV_depth_nonlinear GL_NV_draw_path GL_NV_texture_npot_2D_mipmap GL_OE S_EGL_image GL_OES_EGL_image_external GL_OES_vertex_half_float GL_OES_mapbuffer GL_NV_draw_buffers GL_NV_multiview_draw_buffers GL_EXT_Cg_shader GL_EX T_packed_float GL_OES_texture_half_float GL_EXT_texture_array GL_OES_compressed_ETC1_RGB8_texture GL_EXT_texture_compression_latc GL_NV_texture_compre ssion_latc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_NV_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_NV_get_ tex_image GL_NV_read_buffer GL_NV_shader_framebuffer_fetch GL_NV_copy_image GL_NV_fbo_color_attachments GL_EXT_bgra GL_EXT_texture_format_BGRA8888 GL_ EXT_unpack_subimage GL_NV_pack_subimage GL_NV_texture_compression_s3tc_update GL_NV_read_depth GL_NV_read_stencil GL_NV_uniform_buffer_object GL_EXT_r obustness GL_OES_standard_derivatives GL_NV_EGL_stream_consumer_external GL_NV_3dvision_settings GL_EXT_debug_marker GL_EXT_debug_label GL_NV_ D / Unity(14530): coverage_sample GL_EXT_occlusion_query_boolean GL_NV_timer_query I / Unity(14530):AndroidJavaException: java.lang.ExceptionInInitializerError I / Unity(14530):at UnityEngine.AndroidJNISafe.CheckException()[0x00000] in:0 I / Unity(14530):at UnityEngine.AndroidJNISafe.CallStringMethod(IntPtr obj,IntPtr methodID,UnityEngine.jvalue [] args)[0x00000] in:0 I / Unity(14530):at UnityEngine.AndroidJavaObject._Call [String](System.String methodName, System.Object [] args)[0x00000] in:0
I / Unity(14530):在UnityEngine.AndroidJavaObject.Call [String] (System.String methodName,System.Object [] args)[0x00000] in :0
I / Unity(14530):在CallJavaCode.Start()[0x00000] in:0 I / Unity(14530):I / Unity(14530):(文件名:行:-1)
答案 0 :(得分:0)
我发现我可以从Java中的异常打印堆栈跟踪,当我这样做时,我注意到它询问调用Looper.prepare(),当我调用该函数时,它首先解决了我遇到的问题。 / p>
我从其他jar中集成功能的方式是简单地合并其内容。