为什么 DevTools 调试器与 Android 模拟器上的 App 分离?
Why DevTools debugger detaches from App on Android Emulator?
我的工作流程非常简单,适用于 hello world 应用程序并为我的应用程序工作了一段时间(但不是现在)。
- 启动 AVD(我配置的任何一个)
cordova run --target=emulator-5554 android
- 转到 Chrome 中的
chrome://inspect/#devices
选项卡 http://imgur.com/yF3cgVW
- 在模拟器上运行愉快地检查我的应用程序。
检查运行了几秒钟,然后显示:
http://imgur.com/fnd5MpF(抱歉,没有足够的声誉直接 post 图片)
如果我使用 ADB 连接到模拟器 adb -s emulator-5554 logcat
我会看到此错误行:
E/chromium( 3863): [ERROR:http_connection.cc(35)] Too large read data is pending: capacity=1048576, max_buffer_size=1048576, read=1048576
遇到这个问题,在 Google 中找不到任何东西,除了 http_connection.cc 代码(这很明显,但无论如何都无助于解决这个问题)
这是我的 adb 日志接近错误:
I/art ( 1412): Background sticky concurrent mark sweep GC freed 4681(829KB) AllocSpace objects, 48(768KB) LOS objects, 19% free, 6MB/8MB, paused 20ms total 20ms
E/eglCodecCommon( 3863): glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon( 3863): glUtilsParamSize: unknow param 0x00000bd0
E/chromium( 3863): [ERROR:http_connection.cc(35)] Too large read data is pending: capacity=1048576, max_buffer_size=1048576, read=1048576
E/eglCodecCommon( 3863): glUtilsParamSize: unknow param 0x00000b44
这是我的 cordova 构建日志:
/usr/local/bin/cordova run --target=emulator-5554 android
Running command: /Users/imac/Documents/Prog/MyApp/platforms/android/cordova/run --target=emulator-5554
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.0.1/
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Running: /Users/imac/Documents/Prog/MyApp/platforms/android/gradlew cdvBuildDebug -b /Users/imac/Documents/Prog/MyApp/platforms/android/build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:preReleaseBuild
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:preReleaseBuild
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:compileReleaseJava UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:packageReleaseJar UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:packageReleaseJniLibs UP-TO-DATE
:CordovaLib:packageReleaseLocalJar UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:compileDebugJava UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug UP-TO-DATE
:zipalignDebug UP-TO-DATE
:assembleDebug UP-TO-DATE
:cdvBuildDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 5.246 secs
Built the following apk(s):
/Users/imac/Documents/Prog/MyApp/platforms/android/build/outputs/apk/android-debug.apk
Installing app on emulator...
Using apk: /Users/imac/Documents/Prog/MyApp/platforms/android/build/outputs/apk/android-debug.apk
我已经切换回 21 API 和以前的构建工具,现在一切似乎都运行良好。
更新
Cordova update 稍后在同一问题上也对我有用。
https://code.google.com/p/android/issues/detail?id=182123
我的工作流程非常简单,适用于 hello world 应用程序并为我的应用程序工作了一段时间(但不是现在)。
- 启动 AVD(我配置的任何一个)
cordova run --target=emulator-5554 android
- 转到 Chrome 中的
chrome://inspect/#devices
选项卡 http://imgur.com/yF3cgVW - 在模拟器上运行愉快地检查我的应用程序。
检查运行了几秒钟,然后显示: http://imgur.com/fnd5MpF(抱歉,没有足够的声誉直接 post 图片)
如果我使用 ADB 连接到模拟器 adb -s emulator-5554 logcat
我会看到此错误行:
E/chromium( 3863): [ERROR:http_connection.cc(35)] Too large read data is pending: capacity=1048576, max_buffer_size=1048576, read=1048576
遇到这个问题,在 Google 中找不到任何东西,除了 http_connection.cc 代码(这很明显,但无论如何都无助于解决这个问题)
这是我的 adb 日志接近错误:
I/art ( 1412): Background sticky concurrent mark sweep GC freed 4681(829KB) AllocSpace objects, 48(768KB) LOS objects, 19% free, 6MB/8MB, paused 20ms total 20ms
E/eglCodecCommon( 3863): glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon( 3863): glUtilsParamSize: unknow param 0x00000bd0
E/chromium( 3863): [ERROR:http_connection.cc(35)] Too large read data is pending: capacity=1048576, max_buffer_size=1048576, read=1048576
E/eglCodecCommon( 3863): glUtilsParamSize: unknow param 0x00000b44
这是我的 cordova 构建日志:
/usr/local/bin/cordova run --target=emulator-5554 android
Running command: /Users/imac/Documents/Prog/MyApp/platforms/android/cordova/run --target=emulator-5554
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.0.1/
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Running: /Users/imac/Documents/Prog/MyApp/platforms/android/gradlew cdvBuildDebug -b /Users/imac/Documents/Prog/MyApp/platforms/android/build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:preReleaseBuild
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:preReleaseBuild
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:compileReleaseJava UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:packageReleaseJar UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:packageReleaseJniLibs UP-TO-DATE
:CordovaLib:packageReleaseLocalJar UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:compileDebugJava UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug UP-TO-DATE
:zipalignDebug UP-TO-DATE
:assembleDebug UP-TO-DATE
:cdvBuildDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 5.246 secs
Built the following apk(s):
/Users/imac/Documents/Prog/MyApp/platforms/android/build/outputs/apk/android-debug.apk
Installing app on emulator...
Using apk: /Users/imac/Documents/Prog/MyApp/platforms/android/build/outputs/apk/android-debug.apk
我已经切换回 21 API 和以前的构建工具,现在一切似乎都运行良好。
更新 Cordova update 稍后在同一问题上也对我有用。 https://code.google.com/p/android/issues/detail?id=182123