java - Barcode scanner phonegap app crashes -
java - Barcode scanner phonegap app crashes -
i'm trying install barcode on android application. when phone call bar code application crashes , next log.please help me. in advance.
06-19 16:50:45.913: w/dalvikvm(21407): threadid=1: thread exiting uncaught exception (group=0x2b542210) 06-19 16:50:45.953: e/androidruntime(21407): fatal exception: main 06-19 16:50:45.953: e/androidruntime(21407): java.lang.runtimeexception: unable instantiate activity componentinfo{com.example.crosslegged/com.google.zxing.client.android.captureactivity}: java.lang.classnotfoundexception: com.google.zxing.client.android.captureactivity 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.activitythread.performlaunchactivity(activitythread.java:1891) 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1992) 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.activitythread.access$600(activitythread.java:127) 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.activitythread$h.handlemessage(activitythread.java:1158) 06-19 16:50:45.953: e/androidruntime(21407): @ android.os.handler.dispatchmessage(handler.java:99) 06-19 16:50:45.953: e/androidruntime(21407): @ android.os.looper.loop(looper.java:137) 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.activitythread.main(activitythread.java:4441) 06-19 16:50:45.953: e/androidruntime(21407): @ java.lang.reflect.method.invokenative(native method) 06-19 16:50:45.953: e/androidruntime(21407): @ java.lang.reflect.method.invoke(method.java:511) 06-19 16:50:45.953: e/androidruntime(21407): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:784) 06-19 16:50:45.953: e/androidruntime(21407): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:551) 06-19 16:50:45.953: e/androidruntime(21407): @ dalvik.system.nativestart.main(native method) 06-19 16:50:45.953: e/androidruntime(21407): caused by: java.lang.classnotfoundexception: com.google.zxing.client.android.captureactivity 06-19 16:50:45.953: e/androidruntime(21407): @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:61) 06-19 16:50:45.953: e/androidruntime(21407): @ java.lang.classloader.loadclass(classloader.java:501) 06-19 16:50:45.953: e/androidruntime(21407): @ java.lang.classloader.loadclass(classloader.java:461) 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.instrumentation.newactivity(instrumentation.java:1023) 06-19 16:50:45.953: e/androidruntime(21407): @ android.app.activitythread.performlaunchactivity(activitythread.java:1882) 06-19 16:50:45.953: e/androidruntime(21407): ... 11 more 06-19 16:50:48.013: i/process(21407): sending signal. pid: 21407 sig: 9
here androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.crosslegged" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="19" /> <supports-screens android:largescreens="true" android:normalscreens="true" android:smallscreens="true" android:resizeable="true" android:anydensity="true" /> <uses-permission android:name="android.permission.camera" /> <uses-permission android:name="android.permission.vibrate" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.access_location_extra_commands" /> <uses-permission android:name="android.permission.read_phone_state" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.receive_sms" /> <uses-permission android:name="android.permission.record_audio" /> <uses-permission android:name="android.permission.modify_audio_settings" /> <uses-permission android:name="android.permission.read_contacts" /> <uses-permission android:name="android.permission.write_contacts" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.camera" /> <uses-permission android:name="android.permission.flashlight" /> <uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.camera.front" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> <uses-feature android:name="android.hardware.camera.flash" android:required="false"/> <application android:installlocation="auto" android:debuggable="true" android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.crosslegged.mainactivity" android:configchanges="orientation|keyboardhidden" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name="com.google.zxing.client.android.captureactivity" android:screenorientation="landscape" android:configchanges="orientation|keyboardhidden" android:theme="@android:style/theme.notitlebar.fullscreen" android:windowsoftinputmode="statealwayshidden" android:exported="false"> <intent-filter> <action android:name="com.phonegap.plugins.barcodescanner.scan"/> <category android:name="android.intent.category.default"/> </intent-filter> </activity> </application> </manifest>
here index.html
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width"> <title>my barcode/qr code scanner</title> <style> body{ background:#888888 none repeat scroll 0 0; } input[type='text']{ width:18em; border:1px solid black; } input[type='button']{ width:20em; border:1px solid black; color:#ffffff; font-family:"times new roman",times,serif; font-size:0.9em; font-weight:bold; background:#737ca1; } </style> <script type="text/javascript" src="cordova-2.7.0.js"></script> <script type="text/javascript" src="barcodescanner.js"></script> <script type="text/javascript"> function scancode(){ window.plugins.barcodescanner.scan( function(result){ alert("scanned code: " + result.text + ". format: " + result.format + ". cancelled: " + result.cancelled); }, function(error){ alert("scan failed: " + error); } ); } function encodedata(){ var info = document.getelementbyid("data").value; if (data != ''){ window.plugins.barcodescanner.encode( barcodescanner.encode.text_type, data, function(success){ alert("encode success: " + success); }, function(fail){ alert("encoding failed: " + fail); } ); } else{ alert("please come in data."); homecoming false; } } </script> </head> <body> <h3>barcode/qr code scanner , encoder</h3> <input type="button" value="scan code" onclick="scancode();"/><br/><br/> info : <br/> <input type="text" name="data" id="data" /><br/><br/> <input type="button" value="encode data" onclick="encodedata();"/> </body>
unable instantiate activity componentinfo{com.example.crosslegged/com.google.zxing.client.android.captureactivity}: java.lang.classnotfoundexception: com.google.zxing.client.android.captureactivity
application activity paths messed up, either captureactivity.java not nowadays or path wrong in manifest.
also doesn't create sense utilize 2 application name space(s).
com.example.crosslegged
and
com.google.zxing.client.android.captureactivity
activities path should be:
com.example.crosslegged/activitya com.example.crosslegged/activityb
and on ...
java android cordova phonegap-plugins
Comments
Post a Comment