0

I am trying to make a barcode reader. I used these steps (Integrating the ZXing library directly into my Android application) to make it. After my application ran on emulator when i clicked my "StartScan" button,it showed me "Unfortunately has stopped." I got an error in my logcat. I couldn't understand what wrong is. But i think there is a problem in my androidmanifest.xml Please help me..

Logcat:

E/AndroidRuntime(957): FATAL EXCEPTION: main
 E/AndroidRuntime(957): java.lang.ExceptionInInitializerError
 E/AndroidRuntime(957):     at java.lang.Class.newInstanceImpl(Native Method)
 E/AndroidRuntime(957):     at java.lang.Class.newInstance(Class.java:1319)
 E/AndroidRuntime(957):     at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
 E/AndroidRuntime(957):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
 E/AndroidRuntime(957):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
 E/AndroidRuntime(957):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
 E/AndroidRuntime(957):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
 E/AndroidRuntime(957):     at android.os.Handler.dispatchMessage(Handler.java:99)
 E/AndroidRuntime(957):     at android.os.Looper.loop(Looper.java:137)
 E/AndroidRuntime(957):     at android.app.ActivityThread.main(ActivityThread.java:5041)
 E/AndroidRuntime(957):     at java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime(957):     at java.lang.reflect.Method.invoke(Method.java:511)
 E/AndroidRuntime(957):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
 E/AndroidRuntime(957):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
 E/AndroidRuntime(957):     at dalvik.system.NativeStart.main(Native Method)
 E/AndroidRuntime(957): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
 E/AndroidRuntime(957):     at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:101)
 E/AndroidRuntime(957):     ... 15 more

My AndroidManifest.xml

 <?xml version="1.0" encoding="UTF-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.google.zxing.client.android"
          android:versionName="4.3.1"
          android:versionCode="87"
          android:installLocation="auto"
          android:screenOrientation="landscape">

  <uses-permission android:name="android.permission.CAMERA"/>
 <uses-sdk android:minSdkVersion="15" />

    <application

        android:label="@string/app_name" >
        <activity
            android:name="camera.MainActivity"
            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:label="ZXing"/>
        <intent-filter>

            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.DEFAULT"/> 
                   </intent-filter>
    </application>

</manifest>
Community
  • 1
  • 1
Adaichi
  • 53
  • 1
  • 2
  • 10
  • `Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType` added class in manifest file ?? – Charan Pai Jul 11 '13 at 07:16
  • @SIGSEGV I've added to my manifest.xml but it gave me same error. what's wrong this one? ""' – Adaichi Jul 11 '13 at 08:38
  • I found the answer!This answer (http://stackoverflow.com/a/10140843/2504833) worked well. @Till I thank you so much! – Adaichi Jul 11 '13 at 09:09

0 Answers0