"Class Not Found" error trying to run barcodescanner plugin for Android

1,230 views
Skip to first unread message

Thomas Anderson

unread,
May 22, 2013, 4:57:12 PM5/22/13
to phon...@googlegroups.com
I've spent a few hours trying to trace this one and I'm out of leads.

I'm running:

Cordova 2.5.0
ADT v21.1.0-569685


When I try to run window.plugins.barcodeScanner.scan(), the failure callback returns "Class not found".

My AndroidManifest.xml contains:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />

<activity android:name="com.google.zxing.client.android.CaptureActivity"
 android:screenOrientation="landscape"
 android:clearTaskOnLaunch="true"
 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>
<activity android:name="com.google.zxing.client.android.encode.EncodeActivity" android:label="@string/share_name">
 <intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.ENCODE"/>
<category android:name="android.intent.category.DEFAULT"/>
 </intent-filter>
</activity>
<activity android:name="com.google.zxing.client.android.HelpActivity" android:label="@string/share_name">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

My plugins.xml contains:

<?xml version="1.0" encoding="utf-8"?>
<plugins>
<plugin name="BarcodeScanner" value="com.phonegap.plugins.barcodescanner.BarcodeScanner"/>
</plugins>

The /src directory contains com.phonegap.plugins.barcodescanner/BarcodeScanner.java.  The CaptureActivity library is included as well.  There are no errors in the project, aside from a few minor warnings about "The value of the field BarcodeScanner.EMAIL_TYPE is not used" in BarcodeScanner.java.

Any suggestions on what to check next?

Kind Regards,
- Thomas



Simon MacDonald

unread,
May 22, 2013, 9:30:22 PM5/22/13
to phonegap
The plugins have moved into config.xml. That is probably what your problem is.

Simon Mac Donald
http://hi.im/simonmacdonald
> --
> -- You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>
> To compile in the cloud, check out build.phonegap.com
> ---
> You received this message because you are subscribed to the Google Groups
> "phonegap" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phonegap+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Thomas Anderson

unread,
May 23, 2013, 10:27:27 AM5/23/13
to phon...@googlegroups.com
That did it - thanks Simon!  BTW, you might want to throw in a quick note about that on https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner.  It looks like the docs are slightly out of date as of 2.5 regarding where to stick the plugin XML node.

Thanks for all of your hard work on PhoneGap!


You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/t6nXa_YxcGk/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages