Android之所以开发Dalvik虚拟机而不使用JAVA自带的JVM,如果使用JVM就涉及到了版权问题,这是为什么?

在Android的体系框架中有一部分叫做Android Runtime,即Android运行时环境,这个环境包括了两个部分,一个是Android的核心类库,还有一个就是Dalvik虚拟机了。

Android之所以开发Dalvik虚拟机而不使用JAVA自带的JVM是出于以下两点考虑(个人认为,不代表广泛意义):

1.版权问题,如果使用JVM就涉及到了版权问题,所以google需要在JVM的基础上做一些改进,创造自己的虚拟机。

2.性能问题。当然jvm虚拟机对Java开发来说性能已经足够了,但是相对移动平台的特性,比如低内存,低电量等,就显得有些牵强了,所以为了优化虚拟机的工作效率,google开发了android自己的虚拟机。

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
创建的android虚拟机不显示

为什么创建的android虚拟机不显示 搞了好久 求大神们帮帮忙 一直在这个页面 虚拟机就是不弹出来![图片说明](https://img-ask.csdn.net/upload/201909/25/1569402392_539670.png)

Android Runtime和虚拟机之间是什么关系?

可以理解为虚拟机(JVM, Dalvik, ART)为安卓提供runtime吗?

android虚拟机里程序一直停止运行

ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=edu.nuist.zhangtong.baiduMap/.LoginActivity } logcat: 01-05 00:06:04.698: D/dalvikvm(1225): Not late-enabling CheckJNI (already on) 01-05 00:06:09.188: D/AndroidRuntime(1225): Shutting down VM 01-05 00:06:09.198: W/dalvikvm(1225): threadid=1: thread exiting with uncaught exception (group=0xb2ad2ba8) 01-05 00:06:09.268: E/AndroidRuntime(1225): FATAL EXCEPTION: main 01-05 00:06:09.268: E/AndroidRuntime(1225): Process: edu.nuist.zhangtong.baiduMap, PID: 1225 01-05 00:06:09.268: E/AndroidRuntime(1225): java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.nuist.zhangtong.baiduMap/edu.nuist.zhangtong.baiduMap.LoginActivity}: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.ActivityThread.access$800(ActivityThread.java:135) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.os.Handler.dispatchMessage(Handler.java:102) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.os.Looper.loop(Looper.java:136) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.ActivityThread.main(ActivityThread.java:5017) 01-05 00:06:09.268: E/AndroidRuntime(1225): at java.lang.reflect.Method.invokeNative(Native Method) 01-05 00:06:09.268: E/AndroidRuntime(1225): at java.lang.reflect.Method.invoke(Method.java:515) 01-05 00:06:09.268: E/AndroidRuntime(1225): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 01-05 00:06:09.268: E/AndroidRuntime(1225): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 01-05 00:06:09.268: E/AndroidRuntime(1225): at dalvik.system.NativeStart.main(Native Method) 01-05 00:06:09.268: E/AndroidRuntime(1225): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText 01-05 00:06:09.268: E/AndroidRuntime(1225): at edu.nuist.zhangtong.baiduMap.LoginActivity.onCreate(LoginActivity.java:26) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.Activity.performCreate(Activity.java:5231) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 01-05 00:06:09.268: E/AndroidRuntime(1225): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 01-05 00:06:09.268: E/AndroidRuntime(1225): ... 11 more 01-05 00:07:51.018: I/Process(1225): Sending signal. PID: 1225 SIG: 9

java虚拟机和dalvik垃圾回收机制有和不同

java虚拟机和dalvik垃圾回收机制有和不同?网上也没发现这方面的资料。

关于安卓的art和dalvik模式的问题

安息5.0及以上的版本都实现了使用art运行模式,百度上面也有一些答案,但找不到我想要的。art是在安装APP的时候就预编译成机器码,那么这个编译好的机器码是怎么去执行的,直接使用安卓去执行?dalvik模式是用一个虚拟机去执行一个应用,多个应用就会有多个虚拟机出现,art是怎么去替换原有的dalvik模式的。求大神解答

Android运行报错 求大神指导

12-01 20:49:04.872: D/AndroidRuntime(2097): Shutting down VM 12-01 20:49:04.872: W/dalvikvm(2097): threadid=1: thread exiting with uncaught exception (group=0xb4addb90) 12-01 20:49:04.922: E/AndroidRuntime(2097): FATAL EXCEPTION: main 12-01 20:49:04.922: E/AndroidRuntime(2097): Process: com.doudou, PID: 2097 12-01 20:49:04.922: E/AndroidRuntime(2097): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.doudou/com.doudou.DadoudouActivity}: java.lang.ClassNotFoundException: Didn't find class "com.doudou.DadoudouActivity" on path: DexPathList[[zip file "/data/app/com.doudou-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.doudou-1, /system/lib]] 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2102) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.ActivityThread.access$700(ActivityThread.java:135) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.os.Handler.dispatchMessage(Handler.java:102) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.os.Looper.loop(Looper.java:137) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.ActivityThread.main(ActivityThread.java:4998) 12-01 20:49:04.922: E/AndroidRuntime(2097): at java.lang.reflect.Method.invokeNative(Native Method) 12-01 20:49:04.922: E/AndroidRuntime(2097): at java.lang.reflect.Method.invoke(Method.java:515) 12-01 20:49:04.922: E/AndroidRuntime(2097): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777) 12-01 20:49:04.922: E/AndroidRuntime(2097): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 12-01 20:49:04.922: E/AndroidRuntime(2097): at dalvik.system.NativeStart.main(Native Method) 12-01 20:49:04.922: E/AndroidRuntime(2097): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.doudou.DadoudouActivity" on path: DexPathList[[zip file "/data/app/com.doudou-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.doudou-1, /system/lib]] 12-01 20:49:04.922: E/AndroidRuntime(2097): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 12-01 20:49:04.922: E/AndroidRuntime(2097): at java.lang.ClassLoader.loadClass(ClassLoader.java:497) 12-01 20:49:04.922: E/AndroidRuntime(2097): at java.lang.ClassLoader.loadClass(ClassLoader.java:457) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.Instrumentation.newActivity(Instrumentation.java:1061) 12-01 20:49:04.922: E/AndroidRuntime(2097): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2093) 12-01 20:49:04.922: E/AndroidRuntime(2097): ... 11 more 12-01 20:49:07.812: I/Process(2097): Sending signal. PID: 2097 SIG: 9

在Eclipse中的模拟器中可以运行,但是在手机上不能运行,都是ANdroid 2.3版本的

01-27 15:53:54.449: E/AndroidRuntime(6721): FATAL EXCEPTION: main 01-27 15:53:54.449: E/AndroidRuntime(6721): java.lang.ArrayIndexOutOfBoundsException 01-27 15:53:54.449: E/AndroidRuntime(6721): at com.amaker.wlo.LoginActivity.saveUserMsg(LoginActivity.java:95) 01-27 15:53:54.449: E/AndroidRuntime(6721): at com.amaker.wlo.LoginActivity.login(LoginActivity.java:80) 01-27 15:53:54.449: E/AndroidRuntime(6721): at com.amaker.wlo.LoginActivity.access$1(LoginActivity.java:65) 01-27 15:53:54.449: E/AndroidRuntime(6721): at com.amaker.wlo.LoginActivity$2.onClick(LoginActivity.java:54) 01-27 15:53:54.449: E/AndroidRuntime(6721): at android.view.View.performClick(View.java:2485) 01-27 15:53:54.449: E/AndroidRuntime(6721): at android.view.View$PerformClick.run(View.java:9080) 01-27 15:53:54.449: E/AndroidRuntime(6721): at android.os.Handler.handleCallback(Handler.java:587) 01-27 15:53:54.449: E/AndroidRuntime(6721): at android.os.Handler.dispatchMessage(Handler.java:92) 01-27 15:53:54.449: E/AndroidRuntime(6721): at android.os.Looper.loop(Looper.java:130) 01-27 15:53:54.449: E/AndroidRuntime(6721): at android.app.ActivityThread.main(ActivityThread.java:3821) 01-27 15:53:54.449: E/AndroidRuntime(6721): at java.lang.reflect.Method.invokeNative(Native Method) 01-27 15:53:54.449: E/AndroidRuntime(6721): at java.lang.reflect.Method.invoke(Method.java:507) 01-27 15:53:54.449: E/AndroidRuntime(6721): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875) 01-27 15:53:54.449: E/AndroidRuntime(6721): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633) 01-27 15:53:54.449: E/AndroidRuntime(6721): at dalvik.system.NativeStart.main(Native Method)

java.lang.RuntimeException

java.lang.RuntimeException: Could not read input channel file descriptors from parcel. at android.view.InputChannel.nativeReadFromParcel(Native Method) at android.view.InputChannel.readFromParcel(InputChannel.java:135) at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:671) at android.view.ViewRootImpl.setView(ViewRootImpl.java:672) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:74) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2991) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$600(ActivityThread.java:157) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:153) at android.app.ActivityThread.main(ActivityThread.java:5322) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:848) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:615) at dalvik.system.NativeStart.main(Native Method) 这种异常无从下手,请高手指教

安卓虚拟机总是出现Unfortunately,xxxxxxxx has stopped

是按照《第一行代码》写的,改成跟书上一模一样还出现这个,求指导 ``` 03-15 05:31:41.660: D/gralloc_goldfish(1692): Emulator without GPU emulation detected. 03-15 05:31:45.230: D/AndroidRuntime(1692): Shutting down VM 03-15 05:31:45.230: W/dalvikvm(1692): threadid=1: thread exiting with uncaught exception (group=0xb4abfba8) 03-15 05:31:45.280: E/AndroidRuntime(1692): FATAL EXCEPTION: main 03-15 05:31:45.280: E/AndroidRuntime(1692): Process: com.example.uiwidgettest, PID: 1692 03-15 05:31:45.280: E/AndroidRuntime(1692): java.lang.NullPointerException 03-15 05:31:45.280: E/AndroidRuntime(1692): at com.example.uiwidgettest.MainActivity.onClick(MainActivity.java:48) 03-15 05:31:45.280: E/AndroidRuntime(1692): at android.view.View.performClick(View.java:4438) 03-15 05:31:45.280: E/AndroidRuntime(1692): at android.view.View$PerformClick.run(View.java:18422) 03-15 05:31:45.280: E/AndroidRuntime(1692): at android.os.Handler.handleCallback(Handler.java:733) 03-15 05:31:45.280: E/AndroidRuntime(1692): at android.os.Handler.dispatchMessage(Handler.java:95) 03-15 05:31:45.280: E/AndroidRuntime(1692): at android.os.Looper.loop(Looper.java:136) 03-15 05:31:45.280: E/AndroidRuntime(1692): at android.app.ActivityThread.main(ActivityThread.java:5001) 03-15 05:31:45.280: E/AndroidRuntime(1692): at java.lang.reflect.Method.invokeNative(Native Method) 03-15 05:31:45.280: E/AndroidRuntime(1692): at java.lang.reflect.Method.invoke(Method.java:515) 03-15 05:31:45.280: E/AndroidRuntime(1692): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 03-15 05:31:45.280: E/AndroidRuntime(1692): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 03-15 05:31:45.280: E/AndroidRuntime(1692): at dalvik.system.NativeStart.main(Native Method) ```

java.lang.ClassNotFoundException: com.android.id.impl.IdProviderImpl

巨量引擎SDK接入报错java.lang.ClassNotFoundException: com.android.id.impl.IdProviderImpl 求救,非常感谢! ``` 05/15 16:49:59: Launching 'app' on Pixel 2 API 28. $ adb shell am start -n "com.cn.leaf.demo/com.cn.leaf.demo.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 6411 on device 'Pixel_2_API_28 [emulator-5554]'. Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. I/MultiDex: VM with version 2.1.0 has multidex support Installing application VM has multidex support, MultiDex support library is disabled. W/om.cn.leaf.dem: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking) Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking) Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking) Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking) Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking) W/om.cn.leaf.dem: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection) W/om.cn.leaf.dem: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection) W/om.cn.leaf.dem: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking) D/TrackerDr: f#init: D/TrackerDr: i#init: E/i#IdentifierManager: reflect exception! java.lang.ClassNotFoundException: com.android.id.impl.IdProviderImpl at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:453) at java.lang.Class.forName(Class.java:378) at com.bytedance.a.i$a.<clinit>(SourceFile:195) at com.bytedance.a.i$a.a(SourceFile:185) at com.bytedance.a.i.a(SourceFile:106) at com.bytedance.a.i.<init>(SourceFile:49) at com.bytedance.a.i.b(SourceFile:41) at com.bytedance.a.i.a(SourceFile:34) at com.bytedance.a.g.a(SourceFile:46) at com.bytedance.a.b.a(SourceFile:33) at com.bytedance.applog.b.i.<init>(SourceFile:67) at com.bytedance.applog.AppLog.init(SourceFile:106) at com.cn.leaf.demo.MainActivity.initConfig(MainActivity.java:133) at com.cn.leaf.demo.MainActivity.PerMissions(MainActivity.java:186) at com.cn.leaf.demo.MainActivity.judgeBrand(MainActivity.java:265) at com.cn.leaf.demo.MainActivity.onCreate(MainActivity.java:56) at android.app.Activity.performCreate(Activity.java:7136) at android.app.Activity.performCreate(Activity.java:7127) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.id.impl.IdProviderImpl" on path: DexPathList[[zip file "/data/app/com.cn.leaf.demo-XfKMKxO94jFGo_lzV_gX6A==/base.apk"],nativeLibraryDirectories=[/data/app/com.cn.leaf.demo-XfKMKxO94jFGo_lzV_gX6A==/lib/x86, /data/app/com.cn.leaf.demo-XfKMKxO94jFGo_lzV_gX6A==/base.apk!/lib/x86, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at java.lang.Class.classForName(Native Method)  at java.lang.Class.forName(Class.java:453)  at java.lang.Class.forName(Class.java:378)  at com.bytedance.a.i$a.<clinit>(SourceFile:195)  at com.bytedance.a.i$a.a(SourceFile:185)  at com.bytedance.a.i.a(SourceFile:106)  at com.bytedance.a.i.<init>(SourceFile:49)  at com.bytedance.a.i.b(SourceFile:41)  at com.bytedance.a.i.a(SourceFile:34)  at com.bytedance.a.g.a(SourceFile:46)  at com.bytedance.a.b.a(SourceFile:33)  at com.bytedance.applog.b.i.<init>(SourceFile:67)  at com.bytedance.applog.AppLog.init(SourceFile:106)  at com.cn.leaf.demo.MainActivity.initConfig(MainActivity.java:133)  at com.cn.leaf.demo.MainActivity.PerMissions(MainActivity.java:186)  at com.cn.leaf.demo.MainActivity.judgeBrand(MainActivity.java:265)  at com.cn.leaf.demo.MainActivity.onCreate(MainActivity.java:56)  at android.app.Activity.performCreate(Activity.java:7136)  at android.app.Activity.performCreate(Activity.java:7127)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6669)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)  ```

android的LocationBroadcastManager的包资源配置问题,求指教!

一开始,我创建一个LocationBroadcastManager的变量,结果系统库里识别不了这个类 ![图片说明](https://img-ask.csdn.net/upload/201610/17/1476681057_620065.png) 然后我就上网,看到别人说的解决方法说是:因为没有导入android.support.v4.conten这个包;然后我就按提示导入了support-v4-19.1.0.jar![图片说明](https://img-ask.csdn.net/upload/201610/17/1476681645_561409.png) 之后就没有报错了,但是在运行的时候,又报错,下面是Log: 10-17 01:35:26.788: E/AndroidRuntime(5555): FATAL EXCEPTION: main 10-17 01:35:26.788: E/AndroidRuntime(5555): Process: com.example.broadcastreceive, PID: 5555 10-17 01:35:26.788: E/AndroidRuntime(5555): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager; 10-17 01:35:26.788: E/AndroidRuntime(5555): at com.example.broadcastreceive.MainActivity.onCreate(MainActivity.java:34) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.Activity.performCreate(Activity.java:5990) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.access$800(ActivityThread.java:151) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.os.Handler.dispatchMessage(Handler.java:102) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.os.Looper.loop(Looper.java:135) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.main(ActivityThread.java:5254) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.reflect.Method.invoke(Native Method) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.reflect.Method.invoke(Method.java:372) 10-17 01:35:26.788: E/AndroidRuntime(5555): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 10-17 01:35:26.788: E/AndroidRuntime(5555): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 10-17 01:35:26.788: E/AndroidRuntime(5555): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.LocalBroadcastManager" on path: DexPathList[[zip file "/data/app/com.example.broadcastreceive-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 10-17 01:35:26.788: E/AndroidRuntime(5555): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.ClassLoader.loadClass(ClassLoader.java:469) 10-17 01:35:26.788: E/AndroidRuntime(5555): ... 14 more 10-17 01:35:26.788: E/AndroidRuntime(5555): Suppressed: java.lang.ClassNotFoundException: android.support.v4.content.LocalBroadcastManager 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.Class.classForName(Native Method) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.BootClassLoader.findClass(ClassLoader.java:781) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.ClassLoader.loadClass(ClassLoader.java:504) 10-17 01:35:26.788: E/AndroidRuntime(5555): ... 15 more 10-17 01:35:26.788: E/AndroidRuntime(5555): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available 10-17 01:37:34.075: E/AndroidRuntime(5631): FATAL EXCEPTION: main 10-17 01:37:34.075: E/AndroidRuntime(5631): Process: com.example.broadcastreceive, PID: 5631 10-17 01:37:34.075: E/AndroidRuntime(5631): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager; 10-17 01:37:34.075: E/AndroidRuntime(5631): at com.example.broadcastreceive.MainActivity.onCreate(MainActivity.java:34) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.Activity.performCreate(Activity.java:5990) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.access$800(ActivityThread.java:151) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.os.Handler.dispatchMessage(Handler.java:102) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.os.Looper.loop(Looper.java:135) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.main(ActivityThread.java:5254) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.reflect.Method.invoke(Native Method) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.reflect.Method.invoke(Method.java:372) 10-17 01:37:34.075: E/AndroidRuntime(5631): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 10-17 01:37:34.075: E/AndroidRuntime(5631): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 10-17 01:37:34.075: E/AndroidRuntime(5631): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.LocalBroadcastManager" on path: DexPathList[[zip file "/data/app/com.example.broadcastreceive-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 10-17 01:37:34.075: E/AndroidRuntime(5631): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.ClassLoader.loadClass(ClassLoader.java:469) 10-17 01:37:34.075: E/AndroidRuntime(5631): ... 14 more 10-17 01:37:34.075: E/AndroidRuntime(5631): Suppressed: java.lang.ClassNotFoundException: android.support.v4.content.LocalBroadcastManager 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.Class.classForName(Native Method) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.BootClassLoader.findClass(ClassLoader.java:781) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.ClassLoader.loadClass(ClassLoader.java:504) 10-17 01:37:34.075: E/AndroidRuntime(5631): ... 15 more 10-17 01:37:34.075: E/AndroidRuntime(5631): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available 这个Log不是很看得懂,但是发现java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager; 说是找不到我导入的那个类,于是我在应用库里找,但是能够看到这个类 ![图片说明](https://img-ask.csdn.net/upload/201610/17/1476682996_496913.png) 但是点进这个类,却出现Failed to create the part's controls![图片说明](https://img-ask.csdn.net/upload/201610/17/1476683131_13356.png) 之后我就不知道该怎么继续找问题了,有没有大神能指教一下!!!!!新手自学不容易:(

pContext: java.lang.ClassNotFoundException:

28615-28615/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.tcsoft.gzoa, PID: 28615 java.lang.RuntimeException: Unable to instantiate application com.tcsoft.gzoa.AppContext: java.lang.ClassNotFoundException: Didn't find class "com.tcsoft.gzoa.AppContext" on path: DexPathList[[zip file "/data/app/com.tcsoft.gzoa-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.tcsoft.gzoa-2, /vendor/lib, /system/lib]] at android.app.LoadedApk.makeApplication(LoadedApk.java:507) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4481) at android.app.ActivityThread.access$1500(ActivityThread.java:145) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5181) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tcsoft.gzoa.AppContext" on path: DexPathList[[zip file "/data/app/com.tcsoft.gzoa-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.tcsoft.gzoa-2, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at android.app.Instrumentation.newApplication(Instrumentation.java:975) at android.app.LoadedApk.makeApplication(LoadedApk.java:502) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4481)  at android.app.ActivityThread.access$1500(ActivityThread.java:145)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5181)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)  at dalvik.system.NativeStart.main(Native Method) 

Android 百度地图开发 模拟器被暂停,求大神指点

package com.home.baidumap; import com.baidu.mapapi.SDKInitializer; import com.baidu.mapapi.map.MapView; import android.app.Activity; import android.os.Bundle; import android.view.Window; public class MainActivity extends Activity { MapView mMapView=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); //在使用SDK各组件之前初始化context信息,传入ApplicationContext //注意该方法要再setContentView方法之前实现 SDKInitializer.initialize(getApplicationContext()); //获取地图控件引用 mMapView = (MapView) findViewById(R.id.id_bmapView); setContentView(R.layout.activity_main); } @Override protected void onDestroy() { super.onDestroy(); //在activity执行onDestroy时执行mMapView.onDestroy(),实现地图生命周期管理 mMapView.onDestroy(); } @Override protected void onResume() { super.onResume(); mMapView.onResume(); } @Override protected void onPause() { super.onPause(); //在activity执行onPause时执行mMapView. onPause (),实现地图生命周期管理 mMapView.onPause(); } } Logcat提示错处:08-22 11:22:02.320: E/AndroidRuntime(1804): FATAL EXCEPTION: main Process: com.home.baidumap, PID: 1804 java.lang.RuntimeException: Unable to resume activity {com.home.baidumap/com.home.baidumap.MainActivity}: java.lang.NullPointerException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2817) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) E/AndroidRuntime(1804): at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.home.baidumap.MainActivity.onResume(MainActivity.java:40) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192) at android.app.Activity.performResume(Activity.java:5310) E/AndroidRuntime at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2778)

如何解决Android studio内存不够用的问题?(我放了2张静态图和一张gif图,代码都没错)

(怎么释放android的内存,如何让Bitmap调用recycle()。。。) 08-27 01:51:37.454 18923-18923/com.haoming.hm_xzt.app E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 582912 byte allocation with 75624 free bytes and 73KB until OOM" 08-27 01:51:37.543 18923-18923/com.haoming.hm_xzt.app E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 582912 byte allocation with 75624 free bytes and 73KB until OOM" 08-27 01:51:37.595 18923-18923/com.haoming.hm_xzt.app E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.haoming.hm_xzt.app, PID: 18923 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.haoming.hm_xzt.app/com.haoming.hm_xzt.app.LoginActivity}: android.view.InflateException: Binary XML file line #137: Error inflating class <unknown> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.view.InflateException: Binary XML file line #137: Error inflating class <unknown> at android.view.LayoutInflater.createView(LayoutInflater.java:633) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378) at android.app.Activity.setContentView(Activity.java:2145) at com.haoming.hm_xzt.app.LoginActivity.onCreate(LoginActivity.java:21) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5257)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607)             at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)             at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)             at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)             at android.view.LayoutInflater.inflate(LayoutInflater.java:504)             at android.view.LayoutInflater.inflate(LayoutInflater.java:414)             at android.view.LayoutInflater.inflate(LayoutInflater.java:365)             at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)             at android.app.Activity.setContentView(Activity.java:2145)             at com.haoming.hm_xzt.app.LoginActivity.onCreate(LoginActivity.java:21)             at android.app.Activity.performCreate(Activity.java:5990)             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5257)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.OutOfMemoryError: Failed to allocate a 582912 byte allocation with 75624 free bytes and 73KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988) at android.content.res.Resources.loadDrawableForCookie(Resources.java:2474) at android.content.res.Resources.loadDrawable(Resources.java:2381) at android.content.res.TypedArray.getDrawable(TypedArray.java:749) at android.view.View.<init>(View.java:3737) at android.widget.ImageView.<init>(ImageView.java:139) at android.widget.ImageView.<init>(ImageView.java:135) at android.widget.ImageView.<init>(ImageView.java:131)             at java.lang.reflect.Constructor.newInstance(Native Method)             at java.lang.reflect.Constructor.newInstance(Constructor.java:288)             at android.view.LayoutInflater.createView(LayoutInflater.java:607)             at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)             at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)             at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)             at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)             at android.view.LayoutInflater.inflate(LayoutInflater.java:504)             at android.view.LayoutInflater.inflate(LayoutInflater.java:414)             at android.view.LayoutInflater.inflate(LayoutInflater.java:365)             at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)             at android.app.Activity.setContentView(Activity.java:2145)             at com.haoming.hm_xzt.app.LoginActivity.onCreate(LoginActivity.java:21)             at android.app.Activity.performCreate(Activity.java:5990)             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)             at android.app.ActivityThread.access$800(ActivityThread.java:151)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5257)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

android 自定义键盘报错

android.inputmethodservice.KeyboardView用这个自定义键盘,有时回出现如下错误,求解: ava.lang.RuntimeException: InputChannel is not initialized. at android.view.InputEventReceiver.nativeInit(Native Method) at android.view.InputEventReceiver.(InputEventReceiver.java:70) at android.view.ViewRootImpl$WindowInputEventReceiver.(ViewRootImpl.java:5646) at android.view.ViewRootImpl.setView(ViewRootImpl.java:609) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:259) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2844) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2244) at android.app.ActivityThread.access$800(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5047) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:806) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) at dalvik.system.NativeStart.main(Native Method)

修改了android源码编译问题

我已经成功编译了一次android源代码。 现在我修改了源码下的dalvik/vm/DvmDex.cpp文件。 根据framework框架图,这明显是属于android运行时层的内容。想要在下次运行模拟器的时候看见 这个改动。从新编译整个源码的时间太长了,我应该怎么样编译一下那部分代呢?谢谢,非常感谢。 另外,我目录dalvik/vm/下执行mm,重新生成了一些.so文件。但是再次启动模拟器的时候,并不能看见 这个改动。是否应该需要从新编译生成模拟器。如果是,应该怎么样编译呢?

android桌面开发动态壁纸设置问题?

我自己写了一个android桌面,但无法设置动态壁纸,但android自带的桌面又能设置,设置的动态壁纸是系统内置的,android系统为4.0,总是报如下错误:`V/RenderScript( 2118): 0x128990 RS Thread exited V/RenderScript( 2118): 0x128990 Context::~Context done V/RenderScript( 2118): 0x128990 rsContextDestroy done W/WindowManager( 1917): Failed looking up window W/WindowManager( 1917): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@6e92fa40 does not exist W/WindowManager( 1917): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7163) W/WindowManager( 1917): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7154) W/WindowManager( 1917): at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2209) W/WindowManager( 1917): at com.android.server.wm.Session.remove(Session.java:149) W/WindowManager( 1917): at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124) W/WindowManager( 1917): at com.android.server.wm.Session.onTransact(Session.java:111) W/WindowManager( 1917): at android.os.Binder.execTransact(Binder.java:338) W/WindowManager( 1917): at dalvik.system.NativeStart.run(Native Method) E/InputQueue-JNI( 2548): channel '6e97d310 Media:com.android.wallpaper.livepicker/com.android.wallpaper.livepicker.LiveWallpaperPreview (client)' ~ Publisher closed input channel or an error occurred. events=0x8 W/WindowManager( 1917): Failed looking up window W/WindowManager( 1917): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@6e990550 does not exist W/WindowManager( 1917): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7163) W/WindowManager( 1917): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7154) W/WindowManager( 1917): at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2209) W/WindowManager( 1917): at com.android.server.wm.Session.remove(Session.java:149) W/WindowManager( 1917): at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124) W/WindowManager( 1917): at com.android.server.wm.Session.onTransact(Session.java:111) W/WindowManager( 1917): at android.os.Binder.execTransact(Binder.java:338) W/WindowManager( 1917): at dalvik.system.NativeStart.run(Native Method)`

android下载文件打不开

我用mars老师的源码, ``` /** * 该函数返回整形 -1:代表下载文件出错 0:代表下载文件成功 1:代表文件已经存在 */ public int downFile(String urlStr, String path, String fileName) { InputStream inputStream = null; try { FileUtils fileUtils = new FileUtils(); if (fileUtils.isFileExist(path + fileName)) { return 1; } else { inputStream = getInputStreamFromUrl(urlStr); File resultFile = fileUtils.write2SDFromInput(path,fileName, inputStream); if (resultFile == null) { return -1; } } } catch (Exception e) { e.printStackTrace(); return -1; } finally { try { inputStream.close(); } catch (Exception e) { e.printStackTrace(); } } return 0; } ``` 返回0,成功下载了,而且目录下看到有文件,但是打开显示解析程序包时出现问题,到底怎么回事 ``` new Thread(new Runnable() { @Override public void run() { HttpDownloader httpDownloader = new HttpDownloader(); int result = httpDownloader.downFile("http://xxxxx.apk", "aaaaaaaa/", "xxxxx.apk");//部分省略 System.out.println(result); } }).start(); ``` logcat 02-29 11:12:40.025 8803-8803/com.android.packageinstaller D/asset: failed to open Zip archive '/storage/emulated/0/aaaaaaaa/xxxxx.apk' 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageInstaller: Parse error when parsing manifest. Discontinuing installation 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: Unable to read AndroidManifest.xml of /storage/emulated/0/aaaaaaaa/xxxxx.apk 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: java.io.FileNotFoundException: AndroidManifest.xml 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.content.res.AssetManager.openXmlAssetNative(Native Method) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:488) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:456) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.content.pm.PackageParser.parsePackage(PackageParser.java:528) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at com.android.packageinstaller.PackageUtil.getPackageInfo(PackageUtil.java:73) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at com.android.packageinstaller.PackageInstallerActivity.onCreate(PackageInstallerActivity.java:465) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.Activity.performCreate(Activity.java:5231) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.ActivityThread.access$800(ActivityThread.java:135) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.os.Handler.dispatchMessage(Handler.java:102) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.os.Looper.loop(Looper.java:136) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at android.app.ActivityThread.main(ActivityThread.java:5001) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at java.lang.reflect.Method.invokeNative(Native Method) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at java.lang.reflect.Method.invoke(Method.java:515) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 02-29 11:12:40.061 8803-8803/com.android.packageinstaller W/PackageParser: at dalvik.system.NativeStart.main(Native Method)

虚拟机上显示Unfortunately,xxx has stop,大佬怎么解决

![图片说明](https://img-ask.csdn.net/upload/201711/07/1510021755_662515.jpg) LogCat显示11-07 02:25:35.072: E/AndroidRuntime(2562): FATAL EXCEPTION: main 11-07 02:25:35.072: E/AndroidRuntime(2562): Process: com.example.mycamera, PID: 2562 11-07 02:25:35.072: E/AndroidRuntime(2562): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.mycamera/com.example.mycamera.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.mycamera.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.mycamera-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.mycamera-1/lib/x86_64, /vendor/lib64, /system/lib64]] 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.ActivityThread.-wrap11(ActivityThread.java) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.os.Handler.dispatchMessage(Handler.java:102) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.os.Looper.loop(Looper.java:148) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.ActivityThread.main(ActivityThread.java:5417) 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.reflect.Method.invoke(Native Method) 11-07 02:25:35.072: E/AndroidRuntime(2562): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 11-07 02:25:35.072: E/AndroidRuntime(2562): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 11-07 02:25:35.072: E/AndroidRuntime(2562): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.mycamera.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.mycamera-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.mycamera-1/lib/x86_64, /vendor/lib64, /system/lib64]] 11-07 02:25:35.072: E/AndroidRuntime(2562): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.ClassLoader.loadClass(ClassLoader.java:469) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.Instrumentation.newActivity(Instrumentation.java:1067) 11-07 02:25:35.072: E/AndroidRuntime(2562): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317) 11-07 02:25:35.072: E/AndroidRuntime(2562): ... 9 more 11-07 02:25:35.072: E/AndroidRuntime(2562): Suppressed: java.lang.ClassNotFoundException: com.example.mycamera.MainActivity 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.Class.classForName(Native Method) 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.BootClassLoader.findClass(ClassLoader.java:781) 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 11-07 02:25:35.072: E/AndroidRuntime(2562): at java.lang.ClassLoader.loadClass(ClassLoader.java:504) 11-07 02:25:35.072: E/AndroidRuntime(2562): ... 12 more 11-07 02:25:35.072: E/AndroidRuntime(2562): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐