我最近开始使用Eclipse来构建Android应用程序.我制作了一个小型的Hello_World应用程序,其中包含一个小表. XML代码在下面提供…
<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:weightSum="1" androID:orIEntation="vertical"> <TextVIEw androID:textAppearance="?androID:attr/textAppearanceMedium" androID:ID="@+ID/textVIEw1" androID:layout_height="wrap_content" androID:text="Hello World!" androID:layout_wIDth="wrap_content" /> <tableLayout androID:layout_height="302dp" androID:padding="5dp" androID:layout_wIDth="match_parent" androID:ID="@+ID/TransactionLog"> <tableRow androID:layout_height="wrap_content"> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Date" androID:layout_wIDth="0dip" androID:ID="@+ID/dateLabel"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Details" androID:layout_wIDth="0dip" androID:ID="@+ID/detailsLabel"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Debit" androID:layout_wIDth="0dip" androID:ID="@+ID/debitLabel"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Credit" androID:layout_wIDth="0dip" androID:ID="@+ID/creditLabel"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Balance" androID:layout_wIDth="0dip" androID:ID="@+ID/balanceLabel"></TextVIEw> </tableRow> <tableRow androID:layout_height="wrap_content"> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="5 October 2011" androID:layout_wIDth="0dip" androID:ID="@+ID/date1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="CoCoa Shop" androID:layout_wIDth="0dip" androID:ID="@+ID/details1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="123.53" androID:layout_wIDth="0dip" androID:ID="@+ID/debit1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="0.00" androID:layout_wIDth="0dip" androID:ID="@+ID/credit1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="6729.32" androID:layout_wIDth="0dip" androID:ID="@+ID/balance1"></TextVIEw> </tableRow> <tableRow androID:layout_height="wrap_content"> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="4 October 2011" androID:layout_wIDth="0dip" androID:ID="@+ID/date1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Best Sell" androID:layout_wIDth="0dip" androID:ID="@+ID/details1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="900.53" androID:layout_wIDth="0dip" androID:ID="@+ID/debit1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="0.00" androID:layout_wIDth="0dip" androID:ID="@+ID/credit1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="6729.32" androID:layout_wIDth="0dip" androID:ID="@+ID/balance1"></TextVIEw> </tableRow> <tableRow androID:layout_height="wrap_content"> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="4 October 2011" androID:layout_wIDth="0dip" androID:ID="@+ID/date1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="Deposit" androID:layout_wIDth="0dip" androID:ID="@+ID/details1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="0.00" androID:layout_wIDth="0dip" androID:ID="@+ID/debit1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="9500.00" androID:layout_wIDth="0dip" androID:ID="@+ID/credit1"></TextVIEw> <TextVIEw androID:layout_margin="4dip" androID:layout_weight="1" androID:padding="10dip" androID:layout_height="wrap_content" androID:text="6729.32" androID:layout_wIDth="0dip" androID:ID="@+ID/balance1"></TextVIEw> </tableRow> </tableLayout></linearLayout>
这是Hello_World应用程序的Java代码…
package com.example.helloandroID2;import androID.app.Activity;import androID.os.Bundle;import androID.Widget.TextVIEw;public class HelloAndroID2Activity extends Activity { /** Called when the activity is first created. */ @OverrIDe public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.main); TextVIEw tv = new TextVIEw(this); tv.setText("Hello, AndroID"); setContentVIEw(tv); }}
但是,当我尝试运行我的应用程序时,它显示以下错误…任何人都可以帮助我找出我在哪里出错吗?
## A Fatal error has been detected by the Java Runtime Environment:## Internal Error (classfileParser.cpp:3470), pID=5220, tID=2000# Error: ShouldNotReachHere()## JRE version: 7.0-b147# Java VM: Java HotSpot(TM) ClIEnt VM (21.0-b17 mixed mode windows-x86 )# Failed to write core dump. MinIDumps are not enabled by default on clIEnt versions of windows## An error report file with more information is saved as:# C:\documents and Settings\s4778694\workspace\HelloAndroID2\hs_err_pID5220.log## If you would like to submit a BUG report, please visit:# http://BUGreport.sun.com/BUGreport/crash.Jsp#
编辑
这就是.log文件中的内容(很抱歉,我无法识别文件中的要点,因此我将其全部内容都发布了)
## A Fatal error has been detected by the Java Runtime Environment:## Internal Error (classfileParser.cpp:3470), pID=5220, tID=2000# Error: ShouldNotReachHere()## JRE version: 7.0-b147# Java VM: Java HotSpot(TM) ClIEnt VM (21.0-b17 mixed mode windows-x86 )# Failed to write core dump. MinIDumps are not enabled by default on clIEnt versions of windows## If you would like to submit a BUG report, please visit:# http://BUGreport.sun.com/BUGreport/crash.Jsp#--------------- T H R E A D ---------------Current thread (0x003d7000): JavaThread "UnkNown thread" [_thread_in_vm, ID=2000, stack(0x00900000,0x00950000)]Stack: [0x00900000,0x00950000], sp=0x0094f6dc, free space=317kNative frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)V [jvm.dll+0x1630e1]V [jvm.dll+0x15dcfb]V [jvm.dll+0x18e37]V [jvm.dll+0x1a6a8]V [jvm.dll+0x2a42f]V [jvm.dll+0x2b818]V [jvm.dll+0x2bedb]V [jvm.dll+0x2bf2a]V [jvm.dll+0x2c07d]V [jvm.dll+0x2c15a]V [jvm.dll+0x2c3d7]V [jvm.dll+0x73cb1]V [jvm.dll+0x7406b]V [jvm.dll+0x121a7c]V [jvm.dll+0x14382a]V [jvm.dll+0xa2940]C [javaw.exe+0x1359]C [javaw.exe+0x1dc9]C [javaw.exe+0xa0cb]C [javaw.exe+0xa155]C [kernel32.dll+0xb729] GetmodulefilenameA+0x1ba--------------- P R O C E S S ---------------Java Threads: ( => current thread )Other Threads:=>0x003d7000 (exited) JavaThread "UnkNown thread" [_thread_in_vm, ID=2000, stack(0x00900000,0x00950000)]VM state:not at safepoint (not fully initialized)VM Mutex/Monitor currently owned by a thread: NoneDynamic librarIEs:0x00400000 - 0x0042f000 C:\Program files\Java\jre7\bin\javaw.exe0x7c900000 - 0x7c9b2000 C:\windows\system32\ntdll.dll0x7c800000 - 0x7c8f6000 C:\windows\system32\kernel32.dll0x77dd0000 - 0x77e6b000 C:\windows\system32\ADVAPI32.dll0x77e70000 - 0x77f03000 C:\windows\system32\RPCRT4.dll0x77fe0000 - 0x77ff1000 C:\windows\system32\Secur32.dll0x7e410000 - 0x7e4a1000 C:\windows\system32\USER32.dll0x77f10000 - 0x77f59000 C:\windows\system32\GDI32.dll0x773d0000 - 0x774d3000 C:\windows\WinSxS\x86_Microsoft.windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\COMCTL32.dll0x77c10000 - 0x77c68000 C:\windows\system32\msvcrt.dll0x77f60000 - 0x77fd6000 C:\windows\system32\SHLWAPI.dll0x76390000 - 0x763ad000 C:\windows\system32\IMM32.DLL0x629c0000 - 0x629c9000 C:\windows\system32\LPK.DLL0x74d90000 - 0x74dfb000 C:\windows\system32\USP10.dll0x78aa0000 - 0x78b5e000 C:\Program files\Java\jre7\bin\msvcr100.dll0x6d940000 - 0x6dc61000 C:\Program files\Java\jre7\bin\clIEnt\jvm.dll0x71ad0000 - 0x71ad9000 C:\windows\system32\WSOCK32.dll0x71ab0000 - 0x71ac7000 C:\windows\system32\WS2_32.dll0x71aa0000 - 0x71aa8000 C:\windows\system32\WS2HELP.dll0x76b40000 - 0x76b6d000 C:\windows\system32\WINMM.dll0x76bf0000 - 0x76bfb000 C:\windows\system32\PSAPI.DLL0x6d8d0000 - 0x6d8dc000 C:\Program files\Java\jre7\bin\verify.dll0x6d370000 - 0x6d390000 C:\Program files\Java\jre7\bin\java.dll0x6d920000 - 0x6d933000 C:\Program files\Java\jre7\bin\zip.dllVM Arguments:jvm_args: -Dfile.enCoding=Cp1252 -Xbootclasspath:C:\Program files\AndroID\androID-sdk\platforms\androID-13\androID.jar java_command: <unkNown>Launcher Type: SUN_STANDARDEnvironment Variables:CLAsspATH=.;C:\Program files\Java\jre6\lib\ext\QTJava.zipPATH=C:/Program files/Java/jre7/bin/clIEnt;C:/Program files/Java/jre7/bin;C:/Program files/Java/jre7/lib/i386;C:\PHP\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\Program files\ThinkPad\ConnectUtilitIEs;c:\Program files\Microsoft sql Server0\Tools\Binn\;c:\Program files\Microsoft sql Server0\DTS\Binn\;C:\Program files\QuickTime\QTSystem\;C:\Program files\TortoiseSVN\bin;C:\documents and Settings\s4778694\Desktop\eclipse;USERname=s4778694OS=windows_NTPROCESSOR_IDENTIFIER=x86 Family 6 Model 14 StepPing 8, GenuineIntel--------------- S Y S T E M ---------------OS: windows XP Build 2600 Service Pack 3cpu:total 2 (2 cores per cpu, 1 threads per core) family 6 model 14 stepPing 8, cmov, cx8, fxsr, mmx, sse, sse2, sse3Memory: 4k page, physical 1046864k(59376k free), swap 2514760k(1088876k free)vm_info: Java HotSpot(TM) ClIEnt VM (21.0-b17) for windows-x86 JRE (1.7.0-b147), built on Jun 27 2011 02:25:52 by "java_re" with unkNown MS VC++:1600time: Wed Oct 05 14:05:49 2011elapsed time: 0 seconds
解决方法:
您正在使用Java7.我怀疑AndroID应用程序构建是否可以使用它.降级到Java 6并尝试作为第一步.
总结以上是内存溢出为你收集整理的Android程式无法在模拟器上执行全部内容,希望文章能够帮你解决Android程式无法在模拟器上执行所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)