- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I did an app that when device reat a nfc tag open itself and shows the number of tag
It works without problem. I did it with cordova CLI 4.1.2 and I use nfc plugin com.chariotsolutions.nfc.plugin (version 0.6.2).
Now CLI 4.1.2 is deprecated so I need to update to CLI 5.4.1 at least. I did it and it is all ok.. except for this: when i try to open my app when
nfc tag is discovered app crash ...if instead app is already open nfc tag is read without problem.
When I did my app an year ago to open it for default when nfc tag was discovered I modify Android Manifest adding an intent as shown in Intel Xdk forum
and FAQ so I created a dummy plugin named com.sicursell.wwsrsicursell. Its code is:
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="com.sicursell.wwsrsicursell" version="1.0.0">
<name>Intent NFC</name>
<description>Modify AndroidManifest.xml</description>
<license>MIT</license>
<keywords>android, WebIntent, Intent, Activity, NFC</keywords>
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<!-- android -->
<platform name="android">
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:configChanges="orientation|screenSize|keyboardHidden" android:label="@string/app_name" android:name="CordovaApp">
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</config-file>
</platform>
</plugin>
When I update CLI i need to update plugin version i used otherwise I can't build my app (for example i update nfc plugin to 0.6.6 version).
I try to debug my app with adb manager and the results are:
Cordova CLI 4.1.2 - open app when nfc tag discovered (success)
I/am_focus_stack( 870): [1,exsiting-zone]
I/am_create_task( 870): [0,5852]
I/am_create_activity( 870): [0,327270322,5852,com.android.nfc/.NfcRootActivity,NULL,NULL,NULL,276856832,com.android.nfc,0]
I/wm_task_created( 870): [5852,1]
I/wm_task_moved( 870): [5852,1,9]
I/am_pause_activity( 870): [0,678923140,com.sec.android.app.launcher/com.android.launcher2.Launcher,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_on_paused_called( 3931): [0,com.android.launcher2.Launcher]
I/am_restart_activity( 870): [0,327270322,5852,com.android.nfc/.NfcRootActivity,0]
I/am_create_task( 870): [0,5853]
I/am_create_activity( 870): [0,342976697,5853,com.android.nfc/.KnoxChooserActivity,NULL,NULL,NULL,276824064,com.android.nfc,0]
I/wm_task_created( 870): [5853,1]
I/wm_task_moved( 870): [5853,1,10]
I/am_pause_activity( 870): [0,327270322,com.android.nfc/.NfcRootActivity,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_finish_activity( 870): [0,327270322,5852,com.android.nfc/.NfcRootActivity,app-request,0]
I/am_restart_activity( 870): [0,342976697,5853,com.android.nfc/.KnoxChooserActivity,0]
I/am_on_resume_called( 2678): [0,com.android.nfc.KnoxChooserActivity]
I/am_activity_launch_time( 870): [0,342976697,com.android.nfc/.KnoxChooserActivity,200,265,0]
I/power_partial_wake_state( 870): [0,ActivityManager-Launch]
I/am_destroy_activity( 870): [0,327270322,5852,com.android.nfc/.NfcRootActivity,finish-idle,0]
I/wm_task_removed( 870): [5852,removeAppToken: last token]
I/wm_task_removed( 870): [5852,removeTask]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/am_kill ( 870): [0,3895,com.google.process.gapps,15,empty #21]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/am_proc_died( 870): [0,3895,com.google.process.gapps,15,79,371]
I/am_proc_start( 870): [0,4787,10012,com.google.process.gapps,content provider,com.google.android.gsf/.settings.GoogleSettingsProvider]
I/am_proc_bound( 870): [0,4787,com.google.process.gapps]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/notification_cancel( 870): [1000,870,android,2,NULL,0,0,0,8,NULL]
I/am_kill ( 870): [0,4241,com.samsung.android.sm,15,empty #21]
I/am_proc_died( 870): [0,4241,com.samsung.android.sm,15,68,380]
I/power_partial_wake_state( 870): [0,AudioMix]
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/am_create_task( 870): [0,5854]
I/am_create_activity( 870): [0,845825763,5854,com.sicursell.wwsrsicursell/.CordovaApp,android.nfc.action.TAG_DISCOVERED,NULL,NULL,318767104,com.android.nfc,0]
I/wm_task_created( 870): [5854,1]
I/wm_task_moved( 870): [5854,1,10]
I/am_pause_activity( 870): [0,342976697,com.android.nfc/.KnoxChooserActivity,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_finish_activity( 870): [0,342976697,5853,com.android.nfc/.KnoxChooserActivity,app-request,0]
I/am_on_paused_called( 2678): [0,com.android.nfc.KnoxChooserActivity]
I/am_proc_start( 870): [0,4809,10239,com.sicursell.wwsrsicursell,activity,com.sicursell.wwsrsicursell/.CordovaApp]
I/am_proc_bound( 870): [0,4809,com.sicursell.wwsrsicursell]
I/am_restart_activity( 870): [0,845825763,5854,com.sicursell.wwsrsicursell/.CordovaApp,0]
I/sf_frame_dur( 258): [com.sec.android.app.launcher/com.android.launcher2.Launcher,0,0,0,0,0,0,1]
I/sf_frame_dur( 258): [com.android.nfc/com.android.nfc.KnoxChooserActivity,36,4,1,0,0,0,2]
I/am_on_resume_called( 4809): [0,com.sicursell.wwsrsicursell.CordovaApp]
I/looper_slow_lap_time( 4809): [<unknown>,583]
I/am_activity_launch_time( 870): [0,845825763,com.sicursell.wwsrsicursell/.CordovaApp,890,890,0]
I/power_partial_wake_state( 870): [0,ActivityManager-Launch]
I/am_destroy_activity( 870): [0,342976697,5853,com.android.nfc/.KnoxChooserActivity,finish-imm,0]
I/wm_task_removed( 870): [5853,removeAppToken: last token]
I/wm_task_removed( 870): [5853,removeTask]
I/power_partial_wake_state( 870): [1,TimaService]
I/power_partial_wake_state( 870): [0,TimaService]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
Cordova CLI 5.4.1 - app chrash when nfc tag discovered (crash)
I/am_focus_stack( 870): [1,exsiting-zone]
I/am_create_task( 870): [0,5845]
I/am_create_activity( 870): [0,225831679,5845,com.android.nfc/.NfcRootActivity,NULL,NULL,NULL,276856832,com.android.nfc,0]
I/wm_task_created( 870): [5845,1]
I/wm_task_moved( 870): [5845,1,9]
I/am_pause_activity( 870): [0,678923140,com.sec.android.app.launcher/com.android.launcher2.Launcher,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_on_paused_called( 3931): [0,com.android.launcher2.Launcher]
I/am_restart_activity( 870): [0,225831679,5845,com.android.nfc/.NfcRootActivity,0]
I/am_create_task( 870): [0,5846]
I/am_create_activity( 870): [0,41521706,5846,com.android.nfc/.KnoxChooserActivity,NULL,NULL,NULL,276824064,com.android.nfc,0]
I/wm_task_created( 870): [5846,1]
I/wm_task_moved( 870): [5846,1,10]
I/am_pause_activity( 870): [0,225831679,com.android.nfc/.NfcRootActivity,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_finish_activity( 870): [0,225831679,5845,com.android.nfc/.NfcRootActivity,app-request,0]
I/am_restart_activity( 870): [0,41521706,5846,com.android.nfc/.KnoxChooserActivity,0]
I/am_on_resume_called( 2678): [0,com.android.nfc.KnoxChooserActivity]
I/am_activity_launch_time( 870): [0,41521706,com.android.nfc/.KnoxChooserActivity,238,298,0]
I/power_partial_wake_state( 870): [0,ActivityManager-Launch]
I/am_destroy_activity( 870): [0,225831679,5845,com.android.nfc/.NfcRootActivity,finish-idle,0]
I/wm_task_removed( 870): [5845,removeAppToken: last token]
I/power_partial_wake_state( 870): [1,NlpWakeLock]
I/power_partial_wake_state( 870): [0,NlpWakeLock]
I/power_partial_wake_state( 870): [0,NlpCollectorWakeLock]
I/power_partial_wake_state( 870): [1,NlpWakeLock]
I/power_partial_wake_state( 870): [0,NlpWakeLock]
I/power_partial_wake_state( 870): [0,NlpCollectorWakeLock]
I/power_partial_wake_state( 870): [1,NlpWakeLock]
I/power_partial_wake_state( 870): [0,NlpCollectorWakeLock]
I/power_partial_wake_state( 870): [0,NlpWakeLock]
I/wm_task_removed( 870): [5845,removeTask]
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/backup_data_changed( 870): android
I/am_create_task( 870): [0,5847]
I/am_create_activity( 870): [0,233148911,5847,com.sicursell.wwsrsicursell/.CordovaApp,android.nfc.action.TAG_DISCOVERED,NULL,NULL,318767104,com.android.nfc,0]
I/wm_task_created( 870): [5847,1]
I/wm_task_moved( 870): [5847,1,10]
I/am_pause_activity( 870): [0,41521706,com.android.nfc/.KnoxChooserActivity,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_finish_activity( 870): [0,41521706,5846,com.android.nfc/.KnoxChooserActivity,app-request,0]
I/am_on_paused_called( 2678): [0,com.android.nfc.KnoxChooserActivity]
I/am_proc_start( 870): [0,32577,10237,com.sicursell.wwsrsicursell,activity,com.sicursell.wwsrsicursell/.CordovaApp]
I/am_proc_bound( 870): [0,32577,com.sicursell.wwsrsicursell]
I/am_restart_activity( 870): [0,233148911,5847,com.sicursell.wwsrsicursell/.CordovaApp,0]
I/am_crash( 870): [32577,0,com.sicursell.wwsrsicursell,13155908,java.lang.ClassNotFoundException,Didn't find class "com.sicursell.wwsrsicursell.CordovaApp" on path: DexPathList[[zip file "/data/app/com.sicursell.wwsrsicursell-2/base.apk"],nativeLibraryDirectories=[/data/app/com.sicursell.wwsrsicursell-2/lib/arm, /vendor/lib, /system/lib]],BaseDexClassLoader.java,56]
I/am_finish_activity( 870): [0,233148911,5847,com.sicursell.wwsrsicursell/.CordovaApp,crashed,0]
I/am_focus_stack( 870): [0,movestack to true]
I/wm_task_moved( 870): [5710,1,10]
I/sf_frame_dur( 258): [com.sec.android.app.launcher/com.android.launcher2.Launcher,0,0,0,0,0,0,2]
I/sf_frame_dur( 258): [com.android.nfc/com.android.nfc.KnoxChooserActivity,19,4,2,0,1,1,0]
I/am_pause_activity( 870): [0,233148911,com.sicursell.wwsrsicursell/.CordovaApp,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/am_resume_activity( 870): [0,678923140,5710,com.sec.android.app.launcher/com.android.launcher2.Launcher,0]
I/power_partial_wake_state( 870): [1,*alarm*]
I/am_on_resume_called( 3931): [0,com.android.launcher2.Launcher]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [0,ActivityManager-Launch]
I/am_destroy_activity( 870): [0,233148911,5847,com.sicursell.wwsrsicursell/.CordovaApp,finish-idle,0]
I/am_activity_launch_time( 870): [0,678923140,com.sec.android.app.launcher/com.android.launcher2.Launcher,107,107,0]
I/am_kill ( 870): [0,31709,com.amazon.mShop.android.shopping,15,empty #21]
I/am_proc_died( 870): [0,31709,com.amazon.mShop.android.shopping,15,56,293]
I/am_destroy_activity( 870): [0,41521706,5846,com.android.nfc/.KnoxChooserActivity,finish-imm,0]
I/wm_task_removed( 870): [5846,removeAppToken: last token]
I/wm_task_removed( 870): [5846,removeTask]
I/power_partial_wake_state( 870): [0,AudioMix]
I/am_proc_died( 870): [0,32577,com.sicursell.wwsrsicursell,15,62,293]
I/wm_task_removed( 870): [5847,removeAppToken: last token]
I/wm_task_removed( 870): [5847,removeTask]
I/sf_frame_dur( 258): [Application Error: com.sicursell.wwsrsicursell,21,1,1,0,0,1,0]
Cordova CLI 5.4.1 - app open when nfc tag discovered (success)
I/am_create_task( 870): [0,5848]
I/am_create_activity( 870): [0,945037133,5848,com.sicursell.wwsrsicursell/.MainActivity,android.intent.action.MAIN,NULL,NULL,270532608,com.sec.android.app.launcher,0]
I/wm_task_created( 870): [5848,1]
I/wm_task_moved( 870): [5848,1,9]
I/am_pause_activity( 870): [0,678923140,com.sec.android.app.launcher/com.android.launcher2.Launcher,0]
I/power_partial_wake_state( 870): [1,ActivityManager-Launch]
I/am_on_paused_called( 3931): [0,com.android.launcher2.Launcher]
I/am_proc_start( 870): [0,315,10237,com.sicursell.wwsrsicursell,activity,com.sicursell.wwsrsicursell/.MainActivity]
I/am_proc_bound( 870): [0,315,com.sicursell.wwsrsicursell]
I/am_restart_activity( 870): [0,945037133,5848,com.sicursell.wwsrsicursell/.MainActivity,0]
I/sf_frame_dur( 258): [com.sec.android.app.launcher/com.android.launcher2.Launcher,13,0,2,1,2,1,2]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/am_on_resume_called( 315): [0,com.sicursell.wwsrsicursell.MainActivity]
I/looper_slow_lap_time( 315): [<unknown>,989]
I/am_activity_launch_time( 870): [0,945037133,com.sicursell.wwsrsicursell/.MainActivity,1367,170648,0]
I/sf_frame_dur( 258): [com.sicursell.wwsrsicursell/com.sicursell.wwsrsicursell.MainActivity,168,4,1,0,0,0,0]
I/power_partial_wake_state( 870): [0,ActivityManager-Launch]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [1,SmartFaceService]
I/power_partial_wake_state( 870): [0,SmartFaceService]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [1,*alarm*]
I/power_partial_wake_state( 870): [0,*alarm*]
I/power_partial_wake_state( 870): [1,SmartFaceService]
I/power_partial_wake_state( 870): [1,AudioMix]
I/am_new_intent( 870): [0,866744514,5848,com.sicursell.wwsrsicursell/.MainActivity,android.nfc.action.TAG_DISCOVERED,NULL,NULL,872415232,com.sicursell.wwsrsicursell,0]
I/power_partial_wake_state( 870): [0,SmartFaceService]
I/power_partial_wake_state( 870): [1,ContextManagerWakeLock]
I/power_partial_wake_state( 870): [0,ContextManagerWakeLock]
I/sf_frame_dur( 258): [com.sicursell.wwsrsicursell/com.sicursell.wwsrsicursell.MainActivity,4,1,1,0,0,1,0]
I find this error I/am_crash( 870): [32577,0,com.sicursell.wwsrsicursell,13155908,java.lang.ClassNotFoundException,Didn't find class "com.sicursell.wwsrsicursell.CordovaApp" on path: DexPathList[[zip file "/data/app/com.sicursell.wwsrsicursell-2/base.apk"],nativeLibraryDirectories=[/data/app/com.sicursell.wwsrsicursell-2/lib/arm, /vendor/lib, /system/lib]],BaseDexClassLoader.java,56]
but I don't know how resolve it
...any help or suggestion is very very appreciated!
Thanks All
And
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
check for issue with the NFC plugin you're using, on the github page for that plugin. The issue you're experiencing appears to be due to the plugin, which is outside the scope of the help we can provide, since we do not have intimate knowledge of the many hundreds of third-party plugins that are available. So it is best to refer to the plugin documentation and issues list, first.
Also, try using CLI 6.2.0, as well and insure that all of your plugins are up-to-date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks Paul but I don't think is NFC issue 'cause when app is open all is ok and it reads NFC TAG correctly. I Think issue depends from CLI Version ...4.1.2. OK....5.4.1. KO....with 5.4.1 NFC in descovered but if app is closed when it launch app crash....
besides the error is
I/am_crash( 870): [32577,0,com.sicursell.wwsrsicursell,13155908,java.lang.ClassNotFoundException,Didn't find class "com.sicursell.wwsrsicursell.CordovaApp" on path: DexPathList[[zip file "/data/app/com.sicursell.wwsrsicursell-2/base.apk"],nativeLibraryDirectories=[/data/app/com.sicursell.wwsrsicursell-2/lib/arm, /vendor/lib, /system/lib]],BaseDexClassLoader.java,56]
that is it doesn't found class com.sicursell.wwsrsicursell.CordovaApp the dummy plugin that modify android intent manifest...
any other suggestion?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And -- the Intel XDK does not control how the package is built nor how the target webview (and third-party plugins) behave. The XDK is simply a convenience for packaging and debugging the HTML5 code. The XDK builds standard Cordova hybrid mobile HTML5 apps, we do not "compile" your app or have any bearing on the webview on which your app runs. Please read When is an HTML5 Web App a WebView App? for more background regarding a webview.
Thus, whatever is going wrong is outside the scope of the XDK, it is likely something about:
- your app code
- the NFC plugin code
- the Cordova CLI Android framework
I recommend you search StackOverflow for "cordova app nfc crash" or something like that for insight into what is happening when you are using that plugin (or if you believe it is the intent that is causing the problem).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the answer Paul...I'll follow your suggest but
I don't think problem is the intent 'cause NFC tag is disovered and I can choos which app launch but after i launch it ..app crash
I don't thin error is in NFC plugin code 'cause when app is open i can read NFC tag without problem
maybe problem could be Cordova CLI 'cause with 4.1.2 it's OK with 5.4.1 not...
thanks again
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page