Android M API 23 emulator Unfortunately, browser has stopped - android

I am trying to launch browser on Android M Emulator. It keeps on crashing on every launch.
10-14 13:34:12.934: I/ActivityManager(1294): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=com.android.browser cmp=com.android.browser/.BrowserActivity bnds=[372,692][460,800] (has extras)} from uid 10007 on display 0
10-14 13:34:13.046: I/ActivityManager(1294): Start proc 5514:com.android.browser/u0a17 for activity com.android.browser/.BrowserActivity
10-14 13:34:13.131: W/System(5514): ClassLoader referenced unknown path: /system/app/Browser/lib/x86
10-14 13:34:13.451: E/chromium(5514): [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
10-14 13:34:13.591: D/WebViewTimersControl(5514): onBrowserActivityResume
10-14 13:34:13.591: D/WebViewTimersControl(5514): Resuming webview timers, view=com.android.browser.BrowserWebView{2900a61 VFEDHVC.. ......I. 0,0-0,0}
10-14 13:34:13.861: I/ActivityManager(1294): Displayed com.android.browser/.BrowserActivity: +833ms
10-14 13:34:14.377: A/DEBUG(962): pid: 5514, tid: 5559, name: GpuThread >>> com.android.browser <<<
10-14 13:34:14.500: I/WindowState(1294): WIN DEATH: Window{bd73c76 u0 com.android.browser/com.android.browser.BrowserActivity}
10-14 13:34:14.556: I/ActivityManager(1294): Process com.android.browser (pid 5514) has died
10-14 13:34:14.560: W/ActivityManager(1294): Force removing ActivityRecord{1b3e625 u0 com.android.browser/.BrowserActivity t25}: app died, no saved state

Settings -> Apps -> Browser. then goto permission and enable storage permission to be enabled.because the storage permission is closed default.Just open it!

Edit the Android Virtual Device settings inside you AVD manager that you are using and try starting your emulator with the "Use Host GPU" option enabled, this will help to fix your error with the browser.
For downloading files with the browser make sure you also add enough size to your SD Card option. After editing both settings, start Android and goto: Settings -> Apps -> Browser.
(If needed force to stop the browser) then goto permission and enable storage permission to be enabled. This will fix your error with the browser when downloading files.

Related

Android Studio debugger stops unexpectedly

I'm not being able to debug my app as after setting a breakpoint and debugger stops at it, it then stops suddenly after two or three seconds and app exits with no aparent reason.
I've tried setting the breakpoint at different locations to ensure no other background process is interfering with it, for example at the very beginning of onCreate in splash activity, but the same happens, debugger stops as expected and after a few seconds app exits and debugging session ends unexpectedly.
I've tried updating Android Studio and Gradle to latest version (my AS is 3.6.1) and Gradle 5.6.4 (plugin version is 3.6.1) to no avail. Also tried uninstalling/reinstalling the app to no avail too and lastly I've tried "Invalidate caches and restart" option in Android Studio but it neither worked.
I'm not being able to debug and don't know what else to try / do.
My mobile is a Huawei Mate 20 Lite, and I've also tried rebooting the phone with no success.
Here is my "Logcat" as soon as debugger stops and app exits (app figures as com.mycompany.myapp):
2020-03-06 19:20:39.719 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:39.722 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:39.724 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:39.777 2462-5966/? E/HwNaturalBase: [Binder:2462_10]: clearDataByOwner ignore: Found null values with the given ownerPkgName is[com.mycompany.myapp].
2020-03-06 19:20:39.778 2334-4531/? E/AwareLog: GameSdkConfigReader: GameSdkLog: idNameMap: null
2020-03-06 19:20:39.809 847-861/? E/AwareLog: iawared: GetFileContent open /proc/14267/task/14277/cpuset fail errno(2)!
2020-03-06 19:20:39.815 14269-14269/? E/ssioncontrolle: Not starting debugger since process cannot load the jdwp agent.
2020-03-06 19:20:39.817 838-838/? E/Thermal-daemon: [shell_frame] temp_new :29 temp_old :28
2020-03-06 19:20:39.817 1408-1927/? E/ProcessInfoCollector: getProcessInfo: failed to find this proc
2020-03-06 19:20:39.818 838-838/? E/Thermal-daemon: Report temperature: [shell_frame] temp :29 report_threshold:1
2020-03-06 19:20:39.820 838-838/? E/Thermal-daemon: [ap] temp_new :36 temp_old :35
2020-03-06 19:20:39.821 838-838/? E/Thermal-daemon: Report temperature: [ap] temp :36 report_threshold:1
2020-03-06 19:20:39.855 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:39.857 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:39.865 2033-2033/? E/HwLauncher: PowerSaveLauncherModel onPackageChanged: not inPowerSaveLauncher
2020-03-06 19:20:39.865 2033-2033/? E/HwLauncher: StreetModeLauncherModel onPackageChanged: not inStreetModeLauncher
2020-03-06 19:20:39.889 653-1175/? E/BufferQueueProducer: [com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher#1]:1338: disconnect: not connected (req=1)
2020-03-06 19:20:39.890 653-2692/? E/BufferQueueProducer: [com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher#0]:1338: disconnect: not connected (req=1)
2020-03-06 19:20:39.908 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:39.912 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:39.942 577-14300/? E/ResolverController: No valid NAT64 prefix (123, <unspecified>/0)
2020-03-06 19:20:42.444 1408-8027/? E/WifiService: enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device
2020-03-06 19:20:42.456 1408-1602/? E/WifiService: enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device
2020-03-06 19:20:42.468 2033-2033/? E/HwLauncher: HwAppMarketDownloadModel handleInstallAction op: 2
2020-03-06 19:20:42.663 7452-7525/? E/HSM_UI: SecurityBroadcastReceiver:SecurityBroadcastReceiver the rainbow is not enabled!
2020-03-06 19:20:42.789 577-14311/? E/ResolverController: No valid NAT64 prefix (123, <unspecified>/0)
2020-03-06 19:20:42.956 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:42.963 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:43.173 653-2692/? E/BufferQueueProducer: [Waiting For Debugger: com.mycompany.myapp#0]:1338: disconnect: not connected (req=1)
2020-03-06 19:20:43.185 1408-7773/? E/InputDispatcher: Window handle Window{d9a7484 u0 Waiting For Debugger: com.mycompany.myapp} has no registered input channel
2020-03-06 19:20:43.201 1408-2090/? E/InputDispatcher: Window handle Window{d9a7484 u0 Waiting For Debugger: com.mycompany.myapp} has no registered input channel
2020-03-06 19:20:43.611 14186-14323/com.mycompany.myapp E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile#563b55d
2020-03-06 19:20:43.616 14186-14323/com.mycompany.myapp E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile#fa4bed2
2020-03-06 19:20:43.650 577-14328/? E/ResolverController: No valid NAT64 prefix (123, <unspecified>/0)
2020-03-06 19:20:44.824 838-838/? E/Thermal-daemon: [ap] temp_new :37 temp_old :36
2020-03-06 19:20:44.828 838-838/? E/Thermal-daemon: Report temperature: [ap] temp :37 report_threshold:1
2020-03-06 19:20:45.312 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:45.842 8205-10507/? E/HSC_SEC: VirusPkgParser:parse InputStream is null
2020-03-06 19:20:45.985 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:45.987 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:46.733 879-996/? E/ScreemCommon: <LOGMGR> <logCaptureFilter> [not the beta version or delimitation frozen, no need to capture log]
2020-03-06 19:20:46.733 879-996/? E/ScreemCommon: ### JankSchedHwRead error!
2020-03-06 19:20:46.734 879-996/? E/ScreemCommon: ### ScreemSchedDlmRead read failed!
2020-03-06 19:20:46.735 879-996/? E/ScreemCommon: ### ScreemSchedDlmRead error!
2020-03-06 19:20:46.737 879-996/? E/ScreemCommon: update dlm info failed
2020-03-06 19:20:46.996 2258-2450/? E/HwCHRWifiRSSIGroupSummery: updatArpSummery mRSSI:-1 HwCHRWifiRSSIGroup [rssi_index=4, rtt_tcp_packets=0, rtt_tcp_duration=0, rtt_lan_duration=5066, rtt_lan_failures=0, rtt_lan_succ=396, rtt_lan_max=324, rtt_lan_min=4,same_area_frequency=0,adjacent_area_frequency=0]
2020-03-06 19:20:47.212 2258-2258/? E/CHR_ChrModemStatistics: sensors invalid
2020-03-06 19:20:47.471 2334-17416/? E/AppInfoMgr: not find pkgs by uid: 0
2020-03-06 19:20:49.008 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:49.013 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:49.393 1408-1431/? E/ActivityTaskManager: app boot failure event send
2020-03-06 19:20:49.443 879-3232/? E/LOGSERVER_UTILS: [ZeroHung]sentEvent: result->scope length:3, wpName length:2
2020-03-06 19:20:49.443 879-3232/? E/LOGSERVER_UTILS: [ZeroHung]sentEvent: recoverSolution length:10, recoverResult length:7, keyLog length:31
2020-03-06 19:20:49.479 879-3232/? E/iMonitor: [ZeroHung]appendFile: open /data/log/reliability/appeye/history.log.0 failed
2020-03-06 19:20:49.484 879-998/? E/ScreemHealth: Get an unregisted msg 3.
2020-03-06 19:20:49.512 1408-1587/? E/WindowManager: win=Window{c946538 u0 com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false
2020-03-06 19:20:49.512 1408-1587/? E/WindowManager: win=Window{b8371be u0 com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false
2020-03-06 19:20:49.533 2334-4108/? E/AwareLog: SPKSchedFeature: Uid has been sent, ignore.
2020-03-06 19:20:49.602 1408-1587/? E/ZRHungService: BF and NFW forceStop package: com.mycompany.myapp
2020-03-06 19:20:49.630 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:49.637 1899-4895/? E/HsmCoreServiceImpl: onTransact in code is: 102
2020-03-06 19:20:49.637 2334-4531/? E/AwareLog: GameSdkConfigReader: GameSdkLog: idNameMap: null
2020-03-06 19:20:49.638 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:49.652 21186-21228/? E/AppLifeChangeSensor: CAWARENESS: activityResumed mAppLifeChangeCallback is null
2020-03-06 19:20:49.653 1899-11648/? E/DollieAdapterService: notifyActivityState pkg:com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher state:2 fg:true mUid:10074
2020-03-06 19:20:49.657 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:49.832 838-838/? E/Thermal-daemon: [ap] temp_new :36 temp_old :37
2020-03-06 19:20:49.833 838-838/? E/Thermal-daemon: Report temperature: [ap] temp :36 report_threshold:1
2020-03-06 19:20:50.168 21235-14119/? E/TotemWeather: DeviceStateServiceListener:lastLocation is null
Edit 1:
Inspecting Logcat I can guess that maybe "ZRHungService" is causing the problem, but cannot find any information about this service.
E/ZRHungService: BF and NFW forceStop package: com.mycompany.myapp
Edit 2:
I've tried debugging in a virtual device with success, but the problem is I'm debugging the copy of a file in downloads to cache dir and in virtual device I don't have that file, so I think that's not an option :(
I am getting the same issue if anyone from Huawei, or users of them have found real solutions yet. It's only just started happening on my Mate 20 Pro since it was updated to Android 10 a few days ago.
Here are my logcat lines for the app. Dies after 3-4 secs of being on a breakpoint :
2020-03-10 20:22:24.228 711-981/? E/BufferQueueProducer: [Waiting For Debugger: digital.key.testapp#0]:1338: disconnect: not connected (req=1)
2020-03-10 20:22:24.249 1108-2438/? E/InputDispatcher: Window handle Window{b4506fa u0 Waiting For Debugger: digital.key.testapp} has no registered input channel
2020-03-10 20:22:24.422 8057-8106/digital.key.testapp E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile#77e0f7
2020-03-10 20:22:30.622 1108-1817/? E/ZRHungService: BF and NFW forceStop package: digital.key.testapp
I have found one temporary solution. Set a debug app in your devleoper options on your phone and tell it to wait for debugger. Then launch it and you can attach the debugger from Android Studio and all works well.
Settings -> System and Updates -> Developer Options
Under Debugging find 'Select debug app' and choose your app
Tick ON 'Wait for debugger'
Run app from app drawer
In Android Studio choose attach debugger instead and breakpoints no longer crash
.
Huawei Mate 20 Lite solution I don't know how and why does this work, it's not a scientific method.
For those who doesn't work Captain Wizard's solution, I have found a weird approach for this issue. Some requirments presented above should be considered.
Normal run the app
As fast as you can, go to Run -> Attach to process.. You have to choose this option from the run menu, NOT "Attach Debugger to Android Process" as it will not work.
A pop-up appears, choose the option that appears.
Something finally shows up, don't pay attention to it.
Choose "Attach Debugger to Android Process" icon.
Now, the debugging process should not stop after a few seconds.

Android 8 System App update effective only after reboot

TL;DR: When updating system apps on android, the updated app is only started after reboot.
I am developing a custom ROM based on Android 8.1.2 for a custom device based on Rockchip RK3126c. I took the AOSP source from the board manufacturer and only modified the platform key and added two custom apps as system apps; one is privileged (shared system user), and one isn't, i.e. the first is located in /system/priv-app and signed with the platform key, and the second in /system/app and signed with its own key.
Both apps work, but when I try to update any of the two (via adb shell pm install -r ... or via Android Studio) the update doesn't take effect; the old version still runs, even after killing (adb shell kill -9 ... or throwing a null pointer exception) and restarting it. Only after a full reboot is the new version started. I did increment the versionCode. Before the reboot, getPackageManager().getPackageInfo(...).versionCode yields the new version number, while BuildConfig.VERSION_CODE gives the old one. This is both for eng and user builds.
While updating, adb logcat shows:
10-17 15:45:19.706 1048 1048 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
10-17 15:45:19.725 1058 1058 E asset : setgid: Operation not permitted
10-17 15:45:22.563 336 362 I ActivityManager: Start proc 1062:com.android.defcontainer/u0a11 for service com.android.defcontainer/.DefaultContainerService
10-17 15:45:22.617 1062 1062 I zygote : The ClassLoaderContext is a special shared library.
10-17 15:45:22.739 336 362 I chatty : uid=1000(system) PackageManager expire 1 line
10-17 15:45:22.820 1077 1077 I dex2oat : /system/bin/dex2oat --input-vdex-fd=-1 --output-vdex-fd=14 --compiler-filter=quicken --classpath-dir=/data/app/com.example.myapp-cdF84NESHVxl5UTZHVbRdg== --class-loader-context=PCL[]
10-17 15:45:22.832 1077 1077 W dex2oat : Could not reserve sentinel fault page
10-17 15:45:26.117 1077 1080 W dex2oat : Verification of boolean ao0.a(java.lang.String, long) took 130.568ms
10-17 15:45:28.960 1077 1077 I dex2oat : dex2oat took 6.142s (10.744s cpu) (threads: 4) arena alloc=17KB (17568B) java alloc=4MB (4274432B) native alloc=6MB (6543768B) free=1801KB (1844840B)
10-17 15:45:28.997 336 350 I ActivityManager: Force stopping com.example.myapp appid=1000 user=-1: installPackageLI
10-17 15:45:29.009 336 362 W PackageManager: Trying to update system app code path from /system/priv-app/MyApp to /data/app/MyApp-cdF84NESHVxl5UTZHVbRdg==
10-17 15:45:29.010 336 362 W PackageManager: Code path for com.example.myapp changing from /system/priv-app/MyApp to /data/app/MyApp-cdF84NESHVxl5UTZHVbRdg==
10-17 15:45:29.010 336 362 W PackageManager: Resource path com.example.myapp changing from /system/priv-app/MyApp to /data/app/MyApp-cdF84NESHVxl5UTZHVbRdg==
10-17 15:45:29.205 242 242 E : Couldn't opendir /data/app/vmdl1968223466.tmp: No such file or directory
10-17 15:45:29.205 242 242 E installd: Failed to delete /data/app/vmdl1968223466.tmp: No such file or directory
10-17 15:45:29.213 336 362 I ActivityManager: Force stopping com.example.myapp appid=1000 user=0: pkg removed
10-17 15:45:29.214 1048 1048 I Pm : Package com.example.myapp installed in 9500 ms
10-17 15:45:29.239 1048 1048 I app_process: System.exit called, status: 0
10-17 15:45:29.239 1048 1048 I AndroidRuntime: VM exiting with result code 0.
After the reboot, further updates to the app do work - apparently, the problem only exists when changing the code path from /system/[priv-]app to /data/app, but not when the path is already /data/app.
The same thing worked fine on Android 7.1.2. Deep within the android framework there is probably some cache for the code paths of the apps which doesn't get updated after the app is overwritten. Anyone knows where that is located and how to fix this problem?
After a lot of fiddling, I found it myself: The app was marked as persistent in the manifest, which causes the mentioned behaviour. It only worked on Android 7.1.2 because there was a vendor-specific modification that ignored the persistent flag.

Need some help analyzing Android catlogs to solve constant crashes

I am an owner of a Lenovo K2; due to having a lot of reboots and application crashes, I flashed the official Lenovo Nougat ROM from their recovery tool, performed system factory reset, cleared cache of everything...
Doing so did not resolve the problem at all, so I replicated the crashes and reboots while logging via adb logcat (treshold level Warning).
Here is the complete log: https://www.dropbox.com/s/c9955zdinyemezx/log4.txt?dl=0
I am no expert so I'd appreciate if someone could help me analyse the log I'd be very thankful; here are the most recurring errors:
07-22 19:34:36.375 5135 5135 W PackageManager: Not granting permission android.permission.WRITE_EXTERNAL_STORAGE to package com.lenovo.leos.cloud.sync.row because it was previously installed without
07-22 19:34:36.375 5135 5135 W PackageManager: Unknown permission android.permission.ACCESS_SUPERUSER in package com.lenovo.leos.cloud.sync.row
07-22 19:34:39.504 5135 5135 E DeviceIdleController: Bad device idle settings
07-22 19:34:39.504 5135 5135 E DeviceIdleController: java.lang.IllegalArgumentException: 'null' in 'null' is not a valid key-value pair
And Fatal exceptions thrown when apps crash:
07-22 19:33:56.796 1422 1516 F art : art/runtime/gc/collector/mark_sweep.cc:413] Tried to mark 0x40 not contained by any spaces
07-22 19:34:28.815 4933 4933 F DEBUG : pid: 665, tid: 665, name: fingerprintd >>> /system/bin/fingerprintd <<<
There is a solution for this.
Go to the Settings Page.
Go to 'Apps' Settings.
Find the app package causing this problem and click into it.
Go to 'Permissions' settings and allow all the permissions shown there.
Hope the issue is now solved.

chariotsolutions phonegap-nfc plugin rebooting on scan

I am using PhoneGap build and the chariotsolutions NFC plugin to scan NFC cards, and it was working. However, it started failing after PhoneGap build went down. I can only guess that PhoneGap build is now using a newer version of the plugin. A clean build still makes it crash internally on scan of a card.
I created a new Cordova project with the latest build using the cordova CLI, and installed the chariotsolutions plugin. It is still failing with only the bear bones project, which is outside of PhoneGap build now.
Hardware and software: Android Nexus 7 running Android 4.4.2
Cordova version 3.3
Bear bones project code contains only this onDeviceReady:
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
console.log('v0.0.3');
document.addEventListener('resume', app.resume, false);
document.addEventListener('pause', app.pause, false);
// Read NDEF formatted NFC Tags
nfc.addNdefListener (
function (nfcEvent) {
console.log('nfcEvent '+JSON.stringify(nfcEvent));
var tag = nfcEvent.tag,
ndefMessage = tag.ndefMessage;
// dump the raw json of the message
// note: real code will need to decode
// the payload from each record
console.log(JSON.stringify(ndefMessage));
// assuming the first record in the message has
// a payload that can be converted to a string.
console.log(nfc.bytesToString(ndefMessage[0].payload).substring(3));
},
function () { // success callback
console.log("Waiting for NDEF tag");
},
function (error) { // error callback
console.log("Error adding NDEF listener " + JSON.stringify(error));
}
);
},
ADB output on launch of the app:
I/ActivityManager( 512): Start proc com.test.myapp for activity com.test.myapp/.myappname: pid=17325 uid=10037 gids={50037, 3003}
I/CordovaLog(17325): Changing log level to DEBUG(3)
I/CordovaLog(17325): Found start page location: index.html
D/Whitelist(17325): Unlimited access to network resources
D/CordovaActivity(17325): CordovaActivity.onCreate()
V/WebViewChromium(17325): Binding Chromium to the background looper Looper (main, tid 1) {4211c938}
I/chromium(17325): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain(17325): Initializing chromium process, renderers=0
W/chromium(17325): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
D/libEGL (17325): loaded /system/lib/egl/libEGL_tegra.so
D/libEGL (17325): loaded /system/lib/egl/libGLESv1_CM_tegra.so
D/libEGL (17325): loaded /system/lib/egl/libGLESv2_tegra.so
D/CordovaWebView(17325): CordovaWebView is running on device made by: asus
D/JsMessageQueue(17325): Set native->JS mode to 2
D/CordovaActivity(17325): CordovaActivity.init()
D/CordovaWebView(17325): >>> loadUrl(file:///android_asset/www/index.html)
D/PluginManager(17325): init()
D/CordovaWebView(17325): >>> loadUrlNow()
I/CordovaLog(17325): Changing log level to DEBUG(3)
I/CordovaLog(17325): Found start page location: index.html
D/Whitelist(17325): Unlimited access to network resources
D/CordovaActivity(17325): Resuming the App
D/CordovaActivity(17325): CB-3064: The errorUrl is null
D/SoftKeyboardDetect(17325): Ignore this event
D/OpenGLRenderer(17325): Enabling debug mode 0
D/SoftKeyboardDetect(17325): Ignore this event
I/ActivityManager( 512): Displayed com.test.myapp/.myappname: +813ms
D/AndroidRuntime(17309): Shutting down VM
D/dalvikvm(17309): GC_CONCURRENT freed 97K, 15% free 589K/688K, paused 0ms+2ms, total 5ms
D/CordovaActivity(17325): onMessage(onPageStarted,file:///android_asset/www/index.html)
D/CordovaLog(17325): file:///android_asset/www/index.html: Line 25 : Viewport target-densitydpi is not supported.
I/chromium(17325): [INFO:CONSOLE(25)] "Viewport target-densitydpi is not supported.", source: file:///android_asset/www/index.html (25)
D/CordovaWebViewClient(17325): onPageFinished(file:///android_asset/www/index.html)
D/CordovaActivity(17325): onMessage(onPageFinished,file:///android_asset/www/index.html)
D/CordovaActivity(17325): onMessage(spinner,stop)
D/CordovaNetworkManager(17325): Connection Type: wifi
I/chromium(17325): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/chromium(17325): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
D/CordovaNetworkManager(17325): Connection Type: wifi
D/CordovaActivity(17325): onMessage(networkconnection,wifi)
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 58 : onDeviceReady v0.0.3
I/chromium(17325): [INFO:CONSOLE(58)] "onDeviceReady v0.0.3", source: file:///android_asset/www/js/index.js (58)
D/NfcPlugin(17325): execute registerNdef
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 83 : Waiting for NDEF tag
I/chromium(17325): [INFO:CONSOLE(83)] "Waiting for NDEF tag", source: file:///android_asset/www/js/index.js (83)
D/NfcPlugin(17325): execute init
D/NfcPlugin(17325): Enabling plugin Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.test.myapp/.myappname }
D/NfcDispatcher( 769): Set Foreground Dispatch
D/NfcPlugin(17325): parseMessage Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.test.myapp/.myappname }
D/NfcPlugin(17325): action android.intent.action.MAIN
D/CordovaLog(17325): file:///android_asset/www/plugins/com.chariotsolutions.nfc.plugin/www/phonegap-nfc.js: Line 18 : Initialized the NfcPlugin
I/chromium(17325): [INFO:CONSOLE(18)] "Initialized the NfcPlugin", source: file:///android_asset/www/plugins/com.chariotsolutions.nfc.plugin/www/phonegap-nfc.js (18)
D/CordovaActivity(17325): onMessage(spinner,stop)
ADB output when I scan a card. Seems to pause the app at matched single TECH for some reason, and then reloads Cordova running the onDeviceReady again.
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NfcDispatcher( 769): dispatch tag: TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.NdefFormatable] message: null
I/ActivityManager( 512): START u0 {flg=0x10008000 cmp=com.android.nfc/.NfcRootActivity (has extras)} from pid 769
D/dalvikvm( 512): GC_FOR_ALLOC freed 564K, 15% free 18611K/21744K, paused 145ms, total 145ms
D/dalvikvm( 512): GC_FOR_ALLOC freed 283K, 15% free 18573K/21744K, paused 144ms, total 144ms
I/NfcDispatcher( 769): matched single TECH
D/CordovaActivity(17325): Paused the application!
D/CordovaWebView(17325): Handle the pause
D/NfcPlugin(17325): onPause Intent { }
D/NfcPlugin(17325): stopNfc
D/NfcDispatcher( 769): Set Foreground Dispatch
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 48 : -- pause event fired --
I/chromium(17325): [INFO:CONSOLE(48)] "-- pause event fired -- ", source: file:///android_asset/www/js/index.js (48)
I/ActivityManager( 512): START u0 {act=android.nfc.action.TECH_DISCOVERED cmp=com.widgapp.NFC_ReTAG_FREE/com.widgapp.NFC_ReTag_dispatch_other (has extras)} from pid 769
V/receiver Tag discovered: (15520): TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.NdefFormatable] mifare tagid: 8A0924F9
I/ActivityManager( 512): START u0 {flg=0x4000000 cmp=com.widgapp.NFC_ReTAG_FREE/.automode (has extras)} from pid 15520
D/NfcDispatcher( 769): Set Foreground Dispatch
D/NfcDispatcher( 769): Set Foreground Dispatch
D/dalvikvm(15520): GC_CONCURRENT freed 224K, 4% free 7810K/8072K, paused 4ms+3ms, total 42ms
W/InputMethodManagerService( 512): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#429d7908 attribute=null, token = android.os.BinderProxy#427e6bf8
I/CordovaLog(17325): Changing log level to DEBUG(3)
I/CordovaLog(17325): Found start page location: index.html
D/Whitelist(17325): Unlimited access to network resources
D/CordovaActivity(17325): Resuming the App
D/CordovaActivity(17325): CB-3064: The errorUrl is null
D/NfcPlugin(17325): onResume Intent { }
D/NfcDispatcher( 769): Set Foreground Dispatch
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 41 : -- resume event fired --
I/chromium(17325): [INFO:CONSOLE(41)] "-- resume event fired -- ", source: file:///android_asset/www/js/index.js (41)
D/NativeNfcTag( 769): Tag lost, restarting polling loop
D/dalvikvm(15037): GC_CONCURRENT freed 475K, 7% free 8271K/8824K, paused 3ms+4ms, total 40ms
D/dalvikvm(15037): WAIT_FOR_CONCURRENT_GC blocked 30ms
D/Finsky (15037): [1] 5.onFinished: Installation state replication succeeded.
Any help would be appreciated.
The reason it's not working is because the application is looking for an NDEF tag, but you're scanning a non-NDEF tag.
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NfcDispatcher( 769): dispatch tag: TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.NdefFormatable] message: null
To read a non-NDEF tag, you'll need to add nfc.addNdefFormatableListener or nfc.addTagDiscoveredListener. You can use one event handler, e.g. app.onNFC, for multiple tag types.
You could also use NXP Tag Writer to write a message to the tag, which will also format it as NDEF.
Note that devices with the Broadcom NFC chipset won't read Mifare Classic tags, so you might get errors about non-NDEF messages even when reading a NDEF message on a Mifare Classic tag.
My Nexus 7 (original version) has the NXP NFC chipset. Your code worked, after I removed console.log('nfcEvent '+JSON.stringify(nfcEvent));. The event can't be stringified because of circular references. I think the second generation Nexus 7 uses the Broadcom NFC chipset.

How to debug crashed android native library?

I am runing junit test for native library(C++), native library process crashed and logcat shows:
I/ActivityManager( 161): Force stopping package xxxxx uid=10043
I/ActivityManager( 161): Start proc xxxxx for added application xxxx: pid=1656 uid=10043 gids={1015}
I/TestRunner( 1656): started: testAddressBook(xxxxx.AddressBookTest)
F//system/bin/app_process( 1656): stack corruption detected: aborted
I/ActivityManager( 161): Process xxxxx (pid 1656) has died.
Where xxxxx is the process name.
I try to follow instruction on http://source.android.com/porting/debugging_native.html , but the instruction is confusing:
If it crashes, connect with aproto and run logcat on the device
What is aproto? I can't find it. Nor "stack" tool.
Any suggestion is appreciated!
-Henry
F//system/bin/app_process( 1656): stack corruption detected: aborted
That sounds like you're trashing a local variable. Here's a really popular way to do that:
char localVar[16];
sprintf(localVar, "And this is why sprintf is the devil");
That's not exactly what you asked for, but I hope it helps anyway.

Categories

Resources