Vou por vocês a par do problema e quando ele ocorre.
- O projeto é dividido em:
ParallaxUnlimited
ParallaxUnlimited-android
ParallaxUnlimited-desktop
ParallaxUnlimited-html
- O projeto padrão roda normal e exibe a imagem de teste.
- Tenho o projeto ParallaxDB (Framework de persistencia), ao qual gero um arquivo parallaxdb.jar para ser acessado pelo projeto principal (Android/Desktop/HTML).
- Adiciono o parallaxdb.jar e o sqlite-jdbc-3.7.2.jar no projeto principal. Executo e TUDO continua funcionando corretamente.
[color=darkred]Agora vou gerar o erro[/color]:
Ao chamar uma classe que esta dentro do parallaxdb.jar (Util.getInstance()…) no projeto principal (ParallaxUnlimited), ele gera o import corretamente e nem da erro em tempo de compilação, funciona corretamente no ParallaxUnlimited-desktop, porém quando executo no ParallaxUnlimited-android, ele simplesmente não encontra a classe Util localizada no parallaxdb.jar.
Resolvi desinstalar o jdk7, para ver se em algum lugar ele não estaria indevidamente fazendo referencia (Sim eu olhei o properties de cada projeto), instalei o jdk 6 (Tenho somente ele na maquina agora), dei um clean em todos os projetos e regerei o parallaxdb.jar para re-adicionar na lib do ParallaxUnlimited.
Novamente no desktop funcionou perfeitamente, no Android ocorreu os seguintes erros:
Obs.: Só ter o jar na lib e adicionada ao projeto principal, não gera o erro, esse só ocorre quando, tenacoacessar uma classe dentro dele, e só ocorre em tempo de execução.
Erro 2:
Unable to execute dex: Java heap space
Java heap space
Erro 1: A mensagem abaixo ficou sendo enviada repetidamente.
[2012-11-24 19:50:34 - ParallaxUnlimited-android] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.ibex.nestedvm.util.Sort$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.
Comando que gera o erro:
Obs.: Não uso nada estatico, exceto o metodo “getInstance”, aplico singleton Util.getInstance()
@Edit:
Os arquivos .class estão no jar!
@Edit:
Revisão 21 do SDK/ADT, esta com algum problema, não sou o unico passando por isso.
http://code.google.com/p/android/issues/detail?id=39723
Log de Erro capturado no DDMS:
[quote]11-24 23:28:01.730: E/Trace(788): error opening trace file: No such file or directory (2)
11-24 23:28:01.739: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:01.739: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:01.739: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:01.880: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:01.880: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:01.900: D/dalvikvm(788): Trying to load lib /data/app-lib/br.com.einformacao.parallax-1/libgdx.so 0x40cd9bd8
11-24 23:28:01.900: D/dalvikvm(788): Added shared lib /data/app-lib/br.com.einformacao.parallax-1/libgdx.so 0x40cd9bd8
11-24 23:28:01.900: D/dalvikvm(788): No JNI_OnLoad found in /data/app-lib/br.com.einformacao.parallax-1/libgdx.so 0x40cd9bd8, skipping init
11-24 23:28:02.170: I/dalvikvm(788): Could not find method br.com.einformacao.db.util.Util.getInstance, referenced from method br.com.einformacao.parallax.LaunchGame.render
11-24 23:28:02.170: W/dalvikvm(788): VFY: unable to resolve static method 214: Lbr/com/einformacao/db/util/Util;.getInstance ()Lbr/com/einformacao/db/util/Util;
11-24 23:28:02.170: D/dalvikvm(788): VFY: replacing opcode 0x71 at 0x0036
11-24 23:28:02.390: I/AndroidInput(788): sensor listener setup
11-24 23:28:02.439: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.439: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.439: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.439: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.539: D/libEGL(788): loaded /system/lib/egl/libEGL_emulation.so
11-24 23:28:02.570: D/(788): HostConnection::get() New Host Connection established 0x2a188bf0, tid 788
11-24 23:28:02.600: D/libEGL(788): loaded /system/lib/egl/libGLESv1_CM_emulation.so
11-24 23:28:02.609: D/libEGL(788): loaded /system/lib/egl/libGLESv2_emulation.so
11-24 23:28:02.682: W/EGL_emulation(788): eglSurfaceAttrib not implemented
11-24 23:28:02.699: D/OpenGLRenderer(788): Enabling debug mode 0
11-24 23:28:02.699: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.699: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.790: D/(788): HostConnection::get() New Host Connection established 0x2a19bd90, tid 801
11-24 23:28:02.819: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.859: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.932: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.932: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.949: I/AndroidGraphics(788): OGL renderer: Android Emulator OpenGL ES Translator (GeForce GT 430/PCIe/SSE2)
11-24 23:28:02.960: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.960: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.960: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.960: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:02.960: I/AndroidGraphics(788): OGL vendor: Google (NVIDIA Corporation)
11-24 23:28:02.969: I/AndroidGraphics(788): OGL version: OpenGL ES-CM 1.1 (4.2.0)
11-24 23:28:02.969: I/AndroidGraphics(788): OGL extensions: GL_EXT_debug_marker GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_blend_subtract GL_OES_byte_coordinates GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite GL_OES_single_precision GL_OES_stencil_wrap GL_OES_texture_env_crossbar GL_OES_texture_mirored_repeat GL_OES_EGL_image GL_OES_element_index_uint GL_OES_draw_texture GL_OES_texture_cube_map GL_OES_draw_texture GL_OES_read_format GL_OES_framebuffer_object GL_OES_depth24 GL_OES_depth32 GL_OES_fbo_render_mipmap GL_OES_rgb8_rgba8 GL_OES_stencil1 GL_OES_stencil4 GL_OES_stencil8 GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture
11-24 23:28:02.969: E/EGL_emulation(788): [getAttribValue] Bad attribute idx
11-24 23:28:02.969: E/EGL_emulation(788): tid 801: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
11-24 23:28:02.969: E/EGL_emulation(788): [getAttribValue] Bad attribute idx
11-24 23:28:02.969: E/EGL_emulation(788): tid 801: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
11-24 23:28:03.090: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.160: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.202: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.229: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.229: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.229: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.229: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.239: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.800: I/System.out(788): -----
11-24 23:28:03.830: W/dalvikvm(788): threadid=11: thread exiting with uncaught exception (group=0x40a70930)
11-24 23:28:03.850: E/AndroidRuntime(788): FATAL EXCEPTION: GLThread 78
11-24 23:28:03.850: E/AndroidRuntime(788): java.lang.NoClassDefFoundError: br.com.einformacao.db.util.Util
11-24 23:28:03.850: E/AndroidRuntime(788): at br.com.einformacao.parallax.LaunchGame.render(LaunchGame.java:64)
11-24 23:28:03.850: E/AndroidRuntime(788): at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:449)
11-24 23:28:03.850: E/AndroidRuntime(788): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
11-24 23:28:03.850: E/AndroidRuntime(788): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.869: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
11-24 23:28:03.890: W/ActivityManager(284): Force finishing activity br.com.einformacao.parallax/.MainActivity
11-24 23:28:03.980: D/dalvikvm(788): GC_CONCURRENT freed 198K, 11% free 2567K/2880K, paused 14ms+6ms, total 138ms
11-24 23:28:04.321: W/Trace(788): Unexpected value from nativeGetEnabledTags: 0
[/quote]
O roblema esta na rev. 21, na rev. 20.0.3 funciona perfeitamente.
Alguem tem um link para baixar especificamente a versão do ADT 20.0.3?