I am getting Resources$NotFoundException mostly on Vivo devices. This is only happening for Drawable resources. I have all variant from mdpi till xxxhdpi. All these are pngs. I am unable to replicate this and only getting this on production in 4 different places. 2 of which are in splash screen and 1 is in facebook login library on this line for this drawable. Which means these users are unable to enter the app. Any idea if there some special handling that need to be done for these devices? I have never faced something like this before.
sample code
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:adjustViewBounds="true"
app:srcCompat="#drawable/splash"
app:layout_constraintWidth_max="400dp"
app:layout_constraintBottom_toTopOf="#+id/white_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:src="#drawable/splash"/>
here I am getting this crash due to splash Drawable.
Stack Trace
Caused by android.content.res.Resources$NotFoundException Unable to
find resource ID #0x7f08013d
com.myapp.ui.splashScreen.SplashScreenActivity.onCreate
Caused by android.content.res.Resources$NotFoundException: Unable to
find resource ID #0x7f08013d
at android.content.res.ResourcesImpl.getResourceName(ResourcesImpl.java:292)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:879)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:749)
at android.content.res.Resources.loadDrawable(Resources.java:922)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
at android.content.res.TypedArray.getDrawable(TypedArray.java:928)
at android.widget.ImageView.(ImageView.java:188)
at android.widget.ImageView.(ImageView.java:171)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java:72)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java:68)
at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:187)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:107)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:817)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:775)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:908)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:869)
at android.view.LayoutInflater.inflate(LayoutInflater.java:521)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:141)
at com.myapp.ui.splashScreen.SplashScreenActivity.onCreate(SplashScreenActivity.java:81)
at android.app.Activity.performCreate(Activity.java:7129)
at android.app.Activity.performCreate(Activity.java:7120)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2906)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3031)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1732)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6792)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
I had the same issue for Vivo phones almost exclusively, I then added the image to a noDpi and that resolved it.
Related
Error: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state.
I suddenly noticed this error today, and I'm not sure if it was because I just updated my testing device to Android 8.0. The error message clearly states there's something wrong with setting the ripple effect on the floating action button, and indeed there is no ripple effect when the button is pressed. However, I'm not sure what is causing this problem. Actually, the exact same bug is thrown twice in a row. Any help would be much appreciated! The rest of the app still runs normally, but the bug is really bothering me.
p.s. minSdkVersion is 22, targetSdkVersion and compiledSdkVersion are 27
In MyActivity, line 117 is the data binding and setting the content view.
ActivityMyBinding binding = DataBindingUtil.setContentView(
this, R.layout.activity_my);
Here is the full stacktrace:
W/LayerDrawable: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state.
java.lang.RuntimeException
at android.graphics.drawable.LayerDrawable$ChildDrawable.<init>(LayerDrawable.java:1855)
at android.graphics.drawable.LayerDrawable$LayerState.<init>(LayerDrawable.java:1975)
at android.graphics.drawable.LayerDrawable.createConstantState(LayerDrawable.java:168)
at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1779)
at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1785)
at android.graphics.drawable.RippleDrawable.mutate(RippleDrawable.java:997)
at android.view.View.applyBackgroundTint(View.java:21809)
at android.view.View.setBackgroundDrawable(View.java:21680)
at android.support.design.widget.FloatingActionButton.access$001(FloatingActionButton.java:68)
at android.support.design.widget.FloatingActionButton$ShadowDelegateImpl.setBackgroundDrawable(FloatingActionButton.java:824)
at android.support.design.widget.FloatingActionButtonLollipop.setBackgroundDrawable(FloatingActionButtonLollipop.java:73)
at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:179)
at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:151)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:276)
at android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:261)
at com.generica.genericb.genericc.MyActivity.onCreate(MyActivity.java:117)
at android.app.Activity.performCreate(Activity.java:7174)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
I needed to use app:backgroundTint instead of android:backgroundTint
Changing app:srcCompat="#android:drawable/..." to android:src="#android:drawable/..." fixed it for me.
Strange... whoever posted an answer before pointed me to the solution, but they deleted their answer. =/
They mentioned how a Drawable has a state, and if you assign it to more than one Floating Action Button, then there will be a problem keeping track of the Drawable's state. Apparently with a recent update, this problem was fixed. This led me to realize that I was setting the FAB's source with app:srcCompat rather than android:src.
if you have a Fab in the activity xml, keep the below code and delete android:backgroundTint="#color/colorPrimary"
This solved the issue.
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/list_fab_margin"
android:layout_marginTop="#dimen/list_fab_margin"
android:layout_marginEnd="#dimen/list_fab_margin"
android:layout_marginBottom="#dimen/list_fab_margin"
app:backgroundTint="#color/colorPrimary"
app:fabSize="mini"
app:srcCompat="#drawable/ic_edit"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="41dp"
tools:layout_editor_absoluteY="16dp" />
We're debugging a crash in a Cordova app that seems to happen on launch / foregrounding, after the app was backgrounded for a moderate amount of time and has been to some extent killed by the OS.
At the time of the crash the app is attempting to show a native dialog fragment for Fingerprint Authentication. For some reason in this case the resources for this fragment cannot be found.
It's been reported for Android 6 and 7, on older and newer devices.
java.lang.RuntimeException: Unable to start activity ComponentInfo{ca.koho/ca.koho.Koho}: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2421)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.access$900(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:5440)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1437)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2887)
at android.content.res.Resources.getLayout(Resources.java:1251)
at android.view.LayoutInflater.inflate(LayoutInflater.java:421)
at com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.onCreateView(FingerprintAuthenticationDialogFragment.java:85)
at android.app.Fragment.performCreateView(Fragment.java:2220)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1130)
at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1953)
at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:152)
at android.app.Activity.performCreateCommon(Activity.java:6279)
at android.app.Activity.performCreate(Activity.java:6287)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2374)
... 9 more
Here's the problematic bit of code, from the DialogFragment's onCreateView:
int fingerprint_dialog_container_id = getResources()
.getIdentifier("fingerprint_dialog_container", "layout",
FingerprintAuth.packageName);
View v = inflater.inflate(fingerprint_dialog_container_id, container, false);
When the crash happens, getIdentifier(...) is for some reason returning 0. Most of the time the actual identifier is returned.
I have not found a way to reproduce the crash, and advice to enable developer options like 'Don't keep activities' and 'Background process limit' had did not help.
Thanks for any help.
So, heres the point:
I'm training up and making my first steps in android development and after I narrowed down a few errors myself, I finally came across one that I cant find the solution for.
I want to create an app that displays two pictures that split the screen in half horizontally. So I create a LinearLayout with a vertical orientation and add two RelativeLayout's inside it. I compile it and the build apparently completes but as soon as the app tries to start up on my mobile (Samsung S5 Neo) it says it stopped working and I land up on my desktop again. >.< Also, before tips alike arise - yes I started a new project for testing purposes already and the same error occurs. Also, when I remove that lines of code, the app works just fine on my mobile. So, that's my code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="removedbecausenotyourbusiness:P">
<RelativeLayout
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="match_parent">
<ImageView
android:id="#+id/background2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/background2"
android:scaleType="centerCrop"/>
</RelativeLayout>
<RelativeLayout
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="match_parent">
<ImageView
android:id="#+id/background1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/background1"
android:scaleType="centerCrop"/>
</RelativeLayout>
</LinearLayout>
Also, I'd like to get to know if I can somehow get a log from my mobile as to WHY the app stopped working. Where can I get this?
EDIT: I believe I found what you were asking me for.
12-17 19:27:18.751 11830-11830/? E/Zygote: v2 12-17 19:27:18.751
11830-11830/? E/Zygote: accessInfo : 0 12-17 19:27:20.211
11830-11830/com.example.marco E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.marco, PID: 11830
java.lang.OutOfMemoryError: Failed to allocate a 231444012 byte
allocation with 4182352 free bytes and 125MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:856)
at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:675)
at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:2228)
at
android.content.res.Resources.loadDrawableForCookie(Resources.java:4211)
at android.content.res.Resources.loadDrawable(Resources.java:4085)
at android.content.res.Resources.loadDrawable(Resources.java:3935)
at android.content.res.TypedArray.getDrawable(TypedArray.java:886)
at android.widget.ImageView.(ImageView.java:157)
at android.widget.ImageView.(ImageView.java:145)
at
android.support.v7.widget.AppCompatImageView.(AppCompatImageView.java:60)
at
android.support.v7.widget.AppCompatImageView.(AppCompatImageView.java:56)
at
android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
at
android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1021)
at
android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1080)
at
android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:47)
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:758)
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
at
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)
at
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
at
android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288)
at
android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)
at com.example.marco.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:6877)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3208)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3351)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1796)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7230)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Here is some things you can do to fix the OutOfMemoryError from your images:
Add these lines in your AndroidManifest file under the application at the top:
android:hardwareAccelerated="false"
android:largeHeap="true"
So the very top of of your AndroidManifest will look something like this with the two added lines:
<application
android:hardwareAccelerated="false" //added
android:largeHeap="true" //added
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
If that doesn't fix it, then you will need to compress your image files. You can do that on a site like https://tinyjpg.com/. It is probably just an issue of your images being too large!
Also next time you run into a problem like this, you need to use that error that you received in your crash log / stacktrace and search for the solution. In your case, you could have found this: Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM
I have found this error in my Crashlytics, and it seems like it's only crashing for users with preview version of Android Nougat.
App crashes on startup (Main Activity).
Stacktrace
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.domain/com.my.domain.activities.MainActivity}: android.content.res.Resources$NotFoundException: Can't find ColorStateList from drawable resource ID #0x7f020057
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by android.content.res.Resources$NotFoundException: Can't find ColorStateList from drawable resource ID #0x7f020057
at android.content.res.ResourcesImpl.loadColorStateList(ResourcesImpl.java:840)
at android.content.res.Resources.loadColorStateList(Resources.java:998)
at android.content.res.TypedArray.getColor(TypedArray.java:447)
at android.app.Activity.onApplyThemeResource(Activity.java:4039)
at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:198)
at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:140)
at android.app.Activity.setTheme(Activity.java:4009)
at android.support.v7.app.AppCompatActivity.setTheme(AppCompatActivity.java:90)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2592)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
It looks like Android Nougat no longer supports some kind of system colors that I'm using in my app? But I don't know exactly how to fix it.
Edit
So I found the resource with ID 0x7f020057 in my R file and this is it:
public static final int background_splash_gradient=0x7f020057;
I checked where I am using it and here it is:
<style name="StartingWindowTheme" parent="AppTheme">
<item name="android:windowBackground">#drawable/background_splash_gradient</item>
<item name="android:colorBackground">#drawable/background_splash_gradient</item>
</style>
And this is the background_splash_gradiend xml file:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="135"
android:endColor="#00d49e"
android:startColor="#00bcd4"/>
</shape>
I still don't know why this is causing issues on Nougat. I tried removing the "StartingWindowTheme" style and app now works, it no longer crashes. But I need a better fix than that.
Edit 2
So I tried to remove this line:
<item name="android:colorBackground">#drawable/background_splash_gradient</item>
And it works. Seems like android:colorBackground is the issue.
TEMPORARY FIX
Since the problem is in the line mentioned above, only on Nougat, I have created a values-v24 folder and removed the line there. App works on Nougat now, but I would appreciate a better solution.
I found where the problem was and how to fix it. Here's the solution, I'll keep it simple.
This line was causing the problem:
<item name="android:colorBackground">#drawable/background_splash_gradient</item>
Turns out you can't set drawable as a colorBackground in XML, so it works after removing this line.
The reason this only crashed on Nougat is because this was possible in earlier versions.
It turns out that according with the Android issue tracker, this is Working As Intended.
android:colorBackground expects a color not a drawable.
I got the following crash report in the android market place. While testing I haven't found any crash and my app works fine. Once I published my app I got the following crash report which I have shown below.
But I am not able to find where the crash occurs, I checked in some stack overflow question and there in some cases I got that use of setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); make cause crash in some devices. Is it true because in my app in some activity I have used this line of code in order to change the input type of EditText from password-text / text-password?
Please help me to solve this out.
Stack Trace
java.lang.NullPointerException
at android.widget.TextView.onTouchEvent(TextView.java:7529)
at android.view.View.dispatchTouchEvent(View.java:3933)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1877)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1211)
at android.app.Activity.dispatchTouchEvent(Activity.java:2198)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1852)
at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2382)
at android.view.ViewRoot.handleMessage(ViewRoot.java:2010)
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)
<EditText
android:id="#+id/txt_edit_passwrd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_passwrd_title"
android:background="#drawable/img_password_textbox"
android:cursorVisible="true"
android:layout_marginTop="195dp"
android:hint="#string/passwrd_hint_text"
android:inputType="textPassword"
android:maxLength="10"
android:padding="10dp"
android:textColor="#121212" >
</EditText>
NullPointerException in my own experience tends to mean it cannot find a reference object for instance the edit text your setting the input type for cannot be found, check your layout references and how you've declared the EditText itself.
First check , Have you mention Minimum_sdk_version in android-manifest?
if not then following may be the reason of crashing your application--
If you are using that functionality of android o.s that does not support on customer device.Say you are using Finger_Pointer(as MotionEvent.ACTION_POINTER_DOWN) which does not support before android 2.0.
Or you are using onBackPressed() which does not support for android 1.6.I just gave you hint you can check other issue like this if you have
Updated
For HTC device, TextView's property InputType.TYPE_CLASS_NUMBER lead to crash
Here is the same problem discussed you can refer to this also.
The Solution is not to use "setInputType" with a TextView. You don't need input type filtering for TextViews anyway since they are for displaying text only. Input type is only needed for EditText (and there it works). I had the same problem with Android versions below 4.2.
The disadvantage is, that applying input type "password" on a textview actually makes sense as it masks the password, which may be intended (it was in my case). But this causes random crashes when touching or scrolling over the textview.