Android Fragment support , java.lang.NoSuchMethodException: Fragment(Context,AttributeSet) - android

I try to use fragments with AndroidAnnotations and maven.
It worked with Android 4.0+ , but then I tried to make it work with Android 2.3.3 and I had to use the support-v4 maven library:
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
</dependency>
My fragment is defined as:
<android.support.v4.app.Fragment android:id="#+id/myFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
class="com.bla.HeaderFragment_"/>
and My Activity extends FragmentActivity
I get this exception when I run the app:
.....
Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class android.support.v4.app.Fragment
at android.view.LayoutInflater.createView(LayoutInflater.java:508)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1657)
at com.tagonsoft.codecamp.MainActivity_.setContentView(MainActivity_.java:46)
at com.tagonsoft.codecamp.MainActivity_.onCreate(MainActivity_.java:31)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
... 11 more
Caused by: java.lang.NoSuchMethodException: Fragment(Context,AttributeSet)
at java.lang.Class.getMatchingConstructor(Class.java:643)
at java.lang.Class.getConstructor(Class.java:472)
at android.view.LayoutInflater.createView(LayoutInflater.java:480)
... 22 more
Any idea why?

Try <fragment> tag and name attribute for class name. Also, you've used class name as com.bla.HeaderFragment_ , seems like a typo.
<fragment android:id="#+id/myFragment"
android:name="com.bla.HeaderFragment_"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
More Examples here.

Related

ClassNotFoundException: com.google.android.gms.maps.MapFragment with AndroidStudio

I'm trying to use Google maps v2 on my android App. I'm using Android Studio; I followed steps indicated here: https://developers.google.com/maps/documentation/android/start#overview
In my AndroidManifest.xml I've:
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
On my build.gradle I've:
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 12
targetSdkVersion 16
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.google.android.gms:play-services:3.1.36'
}
My first Activity:
public class HomeActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
}
}
My layout:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment" />
I can compile my project but when I try to deploy to my phone I've this exception:
09-03 17:28:08.604 9787-9787/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{it.mobile/it.mobile.HomeActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2211)
at android.app.ActivityThread.access$600(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:258)
at android.app.Activity.setContentView(Activity.java:1867)
at it.mobile.HomeActivity.onCreate(HomeActivity.java:12)
at android.app.Activity.performCreate(Activity.java:5020)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
... 11 more
Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
at android.app.Fragment.instantiate(Fragment.java:584)
at android.app.Fragment.instantiate(Fragment.java:552)
at android.app.Activity.onCreateView(Activity.java:4668)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
... 20 more
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.MapFragment
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Fragment.instantiate(Fragment.java:574)
... 23 more
In the properties of the project I check export to support library and google services library.
Thanks
At the end I solved the problem recreating a new project in Android Studio. Not sure which was the problem.

You must supply a layout_width attribute in some devices

I am experiencing this problem in my app and I can't seem to understand how it happen. It only occurs in Samsung Galaxy Y phone, I tried this code in other devices and it is ok.
java.lang.RuntimeException: Unable to start activity ComponentInfo{jpac.remaster.gtc/jpac.remaster.gtc.GTCSplash}: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_width attribute.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1658)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3735)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_width attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3598)
at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:3678)
at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1169)
at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:998)
at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:74)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:625)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1657)
at jpac.remaster.gtc.GTCSplash.onCreate(GTCSplash.java:33)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
... 11 more
Can anyone help me with this? btw, here is the xml in question:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/tuna" >
<ImageView
android:id="#+id/dev_logo"
android:layout_width="#dimen/speech_height"
android:layout_height="#dimen/badge_height"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:contentDescription="#string/empty"
android:scaleType="centerInside"
android:src="#drawable/logo_dark" />
</RelativeLayout>
Also the activity for this xml file is the main entry point of the app.
Thanks in advance.
If you have dimensions (or any other values or resources) specified for particular densities or screen sizes, make sure you also have them defined in the generic directory (i.e. "values", "drawable")

Android Google Maps V2 Error inflating fragment

I've seen dozens of similar problems but none have seemed to fix my issue. I have an app that uses google maps v2 (previously used v1). I imported google-play-services and android-support-v4, and created an activity that extended SupportFragment (also tried just fragment). I added all permissions and my key to the manifest, and created a fragment in my layout folder which defines the map. However, my app crashes every time I call setContentView on my fragment within my activity. I imported android.support.v4.app.FragmentActivity and android.support.v4.app.Fragment in this activity, but get an error trying to inflate the fragment. The logcat log is listed below. Thanks in advance!
public class ManualCheckInMapActivity extends android.support.v4.app.FragmentActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_fragment);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.safehouse.onguardianmobile/com.safehouse.onguardianmobile.ManualCheckInMapActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:582)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:200)
at android.app.Activity.setContentView(Activity.java:1647)
at com.safehouse.onguardianmobile.ManualCheckInMapActivity.onCreate(ManualCheckInMapActivity.java:40)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more
Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
at android.support.v4.app.Fragment.instantiate(Fragment.java:401)
at android.support.v4.app.Fragment.instantiate(Fragment.java:369)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
... 20 more
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SupportMapFragment in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.safehouse.onguardianmobile-2.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.support.v4.app.Fragment.instantiate(Fragment.java:391)
... 23 more
UPDATE: I tried cleaning the project, but now get this error. I'm still new at this, no maybe I did not add the libraries properly?
Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'google-play-services_lib'.
Problems encountered while deleting resources.
Could not delete 'C:\Users\Travis\workspace\google-play-services_lib\bin\google-play-services_lib.jar'.
Problems encountered while deleting files.
Could not delete: C:\workspace\google-play-services_lib\bin\google-play-services_lib.jar.
Problems encountered while deleting resources.
Could not delete 'C:\workspace\google-play-services_lib\bin\google-play-services_lib.jar'.
Problems encountered while deleting files.
Could not delete: C:\Users\Travis\workspace\google-play-services_lib\bin\google-play-services_lib.jar.

org.xmlpull.v1.XmlPullParserException for "invalid drawable tag bitmap"

Ok, that's weird.
I've received this error for one of my activities, the weird thing is that the bitmap is used in every Activity! I don't even know how to reproduce the exception, it's working fine for me (and others I think).
This is the whole stacktrace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{it.enrichman.bolloauto/it.enrichman.bolloauto.activities.ArchivioActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class android.widget.ListView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1872)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4385)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class android.widget.ListView
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:250)
at android.app.Activity.setContentView(Activity.java:1742)
at it.enrichman.bolloauto.activities.ArchivioActivity.onCreate(ArchivioActivity.java:36)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.view.LayoutInflater.createView(LayoutInflater.java:505)
... 22 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/backrepeat.xml from color state list resource ID #0x7f020075
at android.content.res.Resources.loadColorStateList(Resources.java:1855)
at android.content.res.TypedArray.getColor(TypedArray.java:319)
at android.widget.AbsListView.<init>(AbsListView.java:632)
at android.widget.ListView.<init>(ListView.java:164)
at android.widget.ListView.<init>(ListView.java:160)
... 25 more
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag bitmap
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:146)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:129)
at android.content.res.Resources.loadColorStateList(Resources.java:1852)
... 29 more
The "missing" resource is this one (inside drawable folder):
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#drawable/bg"
android:tileMode="repeat" />
The "bg" drawable is inside drawable-hdpi (could be that a problem?), but as I said it's used in every activity as background!
The error is called during the setting of the layout:
setContentView(R.layout.archivio);
The xml layout is this one:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BLABLABLA"
android:id="#+id/archivioTextView" android:layout_gravity="center_horizontal"
android:gravity="center_horizontal" android:textIsSelectable="false" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" android:layout_marginRight="30dp" android:layout_marginLeft="30dp"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/listaVeicoli" android:layout_gravity="center" android:drawSelectorOnTop="false"/>
</LinearLayout>
(Some of the useless statements are put by the Designer of IntelliJ!)
I've looked for similar problems but I don't have "strange" id like #+id/list or other problems that other users encuntered..
Any help on this? What am I missing?
Thanks
In the end I've found FINALLY the solution.
I've tried with different emulator and I was having this crash only with API 10 (2.3.3) or less. Looking around the xmls and trying to do different stuff (also copying the bg drawable everywhere, or changing id to my list) I've found this weird stuff in my custom theme:
<item name="android:windowBackground">#drawable/backrepeat</item>
<item name="android:colorBackground">#drawable/backrepeat</item>
This seems to be not a problem for newer android version but for older one yes.
Just remove the colorBackground definition (that maybe should be only a color) and that's it!
I hope this will help someone else!
Create a drawable folder inside res folder.
Try keeping your bg inside "res/drawable/".
Hope this will help you.
Put your selector into the res/drawable folder and also give the Listview id as android:id="#+android:id/list".
I hope it will help you out.
Thanks.

zxing android integration crash on some devices , he following classes could not be instantiated: - com.google.zxing.client.android.ViewfinderView

I have integrated Zxing as Library and used in my application. I am calling by
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_FORMATS", "CODE_39");
intent.putExtra("SAVE_HISTORY", false);
startActivityForResult(intent, 0);
It works fine on most devices but on Some devices like HTC Desire ,GT-I9000 . I am receiving below Error.
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.Armacell.login/com.google.zxing.client.android.CaptureActivity}:
android.view.InflateException: Binary XML file line #25: Error
inflating class com.google.zxing.client.android.ViewfinderView at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:123) at
android.app.ActivityThread.main(ActivityThread.java:4627) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:521) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) at
dalvik.system.NativeStart.main(Native Method) Caused by:
android.view.InflateException: Binary XML file line #25: Error
inflating class com.google.zxing.client.android.ViewfinderView at
android.view.LayoutInflater.createView(LayoutInflater.java:513) at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) at
android.view.LayoutInflater.inflate(LayoutInflater.java:407) at
android.view.LayoutInflater.inflate(LayoutInflater.java:320) at
android.view.LayoutInflater.inflate(LayoutInflater.java:276) at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:200)
at android.app.Activity.setContentView(Activity.java:1647) at
com.google.zxing.client.android.CaptureActivity.onCreate(CaptureActivity.java:160)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more Caused by: java.lang.reflect.InvocationTargetException at
com.google.zxing.client.android.ViewfinderView.(ViewfinderView.java:62)
at java.lang.reflect.Constructor.constructNative(Native Method) at
java.lang.reflect.Constructor.newInstance(Constructor.java:446) at
android.view.LayoutInflater.createView(LayoutInflater.java:500) ... 21
more Caused by: android.content.res.Resources$NotFoundException:
Resource is not a Drawable (color or path):
TypedValue{t=0x1/d=0x7f070012 a=-1 r=0x7f070012} at
android.content.res.Resources.loadDrawable(Resources.java:1681) at
android.content.res.TypedArray.getDrawable(TypedArray.java:601) at
android.view.View.(View.java:1895) at
android.view.View.(View.java:1844) ... 25 more
I am also receiving this warning on Capture.xml file in zxing source -
"The following classes could not be instantiated:
- com.google.zxing.client.android.ViewfinderView"
I am requesting all to help in this case. Thanks in Advance.
This is all wrong -- you're including our Android code in your app. It's not necessary, not encouraged, and you haven't done it correctly either. Please delete all code you copied from android/ into your project.
(In fact we strongly discourage you from copying and pasting like you have.)
Instead you should just be using code in android-integration and nothing else. You're not actually using the integrator code even!
Please start over from: http://code.google.com/p/zxing/wiki/ScanningViaIntent
I have Got Solution on My Own.
The Issue is regarding Culture. I have change default "values". make "values-de" to "values". That crashes Zxing on device that have German culture.
I don't know why it was working but now i have made english as default and it working now :)

Categories

Resources