1

My application is gone crash on below android 7 version phones. This is the link of my application https://play.google.com/store/apps/details?id=comdhanusharea.wixsite.benitinhere.phonebook.

I don't know why i am getting this crash report.When i try to install my application in below android version 7 phone application crash and show me that

Unfortunately,Application is stopped

I received this crash report on my developer account.

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2338)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2390)
  at android.app.ActivityThread.access$800 (ActivityThread.java:151)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1321)
  at android.os.Handler.dispatchMessage (Handler.java:110)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:5292)
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:824)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:640)
  at dalvik.system.NativeStart.main (Native Method)
Caused by: android.view.InflateException: 
  at android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:713)
  at android.view.LayoutInflater.rInflate (LayoutInflater.java:755)
  at android.view.LayoutInflater.rInflate (LayoutInflater.java:758)
  at android.view.LayoutInflater.rInflate (LayoutInflater.java:758)
  at android.view.LayoutInflater.rInflate (LayoutInflater.java:758)
  at android.view.LayoutInflater.inflate (LayoutInflater.java:492)
  at android.view.LayoutInflater.inflate (LayoutInflater.java:397)
  at android.view.LayoutInflater.inflate (LayoutInflater.java:353)
  at android.support.v7.app.AppCompatDelegateImplV9.setContentView (AppCompatDelegateImplV9.java:287)
  at android.support.v7.app.AppCompatActivity.setContentView (AppCompatActivity.java:139)
  at comdhanusharea.wixsite.benitinhere.phonebook.A2_Login.onCreate (A2_Login.java:36)
  at android.app.Activity.performCreate (Activity.java:5264)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1088)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2302)
Caused by: android.content.res.Resources$NotFoundException: 
  at android.content.res.Resources.loadDrawable (Resources.java:2124)
  at android.content.res.TypedArray.getDrawable (TypedArray.java:602)
  at android.widget.ImageView.<init> (ImageView.java:129)
  at android.support.v7.widget.AppCompatImageView.<init> (AppCompatImageView.java:72)
  at android.support.v7.widget.AppCompatImageView.<init> (AppCompatImageView.java:68)
  at android.support.v7.app.AppCompatViewInflater.createView (AppCompatViewInflater.java:106)
  at android.support.v7.app.AppCompatDelegateImplV9.createView (AppCompatDelegateImplV9.java:1024)
  at android.support.v7.app.AppCompatDelegateImplV9.onCreateView (AppCompatDelegateImplV9.java:1081)
  at android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:684)

This is my Java Code of A2_Login onCreate function

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_a2__login);
        SharedPreferences preferences=getSharedPreferences("PhoneBook",MODE_PRIVATE);
        Boolean b= preferences.getBoolean("IsLogin",false);
        if(b)
        {
            startActivity(new Intent(this,A3_HomePage.class));
            finish();
        }
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
            if (ContextCompat.checkSelfPermission(A2_Login.this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED &&
                    ContextCompat.checkSelfPermission(A2_Login.this, Manifest.permission.WRITE_CONTACTS) != PackageManager.PERMISSION_GRANTED
                   )
            {
                ActivityCompat.requestPermissions(A2_Login.this, new String[]{Manifest.permission.READ_CONTACTS}, REQUEST_PHONE_CALL);
                ActivityCompat.requestPermissions(A2_Login.this, new String[]{Manifest.permission.WRITE_CONTACTS}, REQUEST_PHONE_CALL);
            }
            if( ContextCompat.checkSelfPermission(A2_Login.this, Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED){
                ActivityCompat.requestPermissions(A2_Login.this, new String[]{Manifest.permission.INTERNET}, REQUEST_PHONE_CALL);
            }
        }
        else{
            if (ContextCompat.checkSelfPermission(A2_Login.this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED &&
                    ContextCompat.checkSelfPermission(A2_Login.this, Manifest.permission.WRITE_CONTACTS) != PackageManager.PERMISSION_GRANTED
                   )
            {
                ActivityCompat.requestPermissions(A2_Login.this, new String[]{Manifest.permission.READ_CONTACTS}, REQUEST_PHONE_CALL);
                ActivityCompat.requestPermissions(A2_Login.this, new String[]{Manifest.permission.WRITE_CONTACTS}, REQUEST_PHONE_CALL);
                }
            if( ContextCompat.checkSelfPermission(A2_Login.this, Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED){
                ActivityCompat.requestPermissions(A2_Login.this, new String[]{Manifest.permission.INTERNET}, REQUEST_PHONE_CALL);
            }
        }
        db = openOrCreateDatabase("db_contactmanager", MODE_PRIVATE, null);
        db.execSQL("Create Table If Not Exists tbl_register(" +
                "db_regiser_id Integer Primary Key AutoIncrement," +
                "db_gender nvarchar(20)," +
                "db_fname nvarchar(20)," +
                "db_lname nvarchar(20)," +
                "db_mobile nvarchar(13)," +
                "db_mail nvarchar(50)," +
                "db_passwd nvarchar(15))");
        db.execSQL("Create Table If Not Exists tbl_root1(" +
                "db_security nvarchar(50) not null," +
                "db_fname nvarchar(20)," +
                "db_lname nvarchar(20)," +
                "db_mobile nvarchar(13)," +
                "db_mail nvarchar(50)," +
                "db_passwd nvarchar(15))");
        edt_phone_mail = (EditText) findViewById(R.id.A2_edt_phone_mail);
        edit_passwd = (EditText) findViewById(R.id.A2_edt_passwd);
    }

And this is my layout file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/back2"
    android:orientation="vertical"
    tools:context="comdhanusharea.wixsite.benitinhere.phonebook.A2_Login">


    <TextView
        android:id="@+id/A2_r_txt"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="30dp"
        android:layout_weight="1.5"
        android:fontFamily="cursive"
        android:gravity="center"
        android:text="Sign In"
        android:textColor="@color/md_black_1000"
        android:textSize="50dp"
        android:textStyle="bold" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/A2_r_txt">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="25dp"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/A2_r_ll1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/A2_r_txt"
                android:layout_weight="1">


                <ImageView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="8dp"
                    android:layout_weight=".5"
                    android:backgroundTint="@color/colorPrimary"
                    android:src="@drawable/username" />


                <EditText
                    android:id="@+id/A2_edt_phone_mail"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_weight="4.6"
                    android:backgroundTint="@color/colorPrimary"
                    android:ems="10"
                    android:hint="Enter Email id or Phone number"
                    android:inputType="text"
                    android:padding="20dp" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/A2_r_ll2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/A2_r_ll1"
                android:layout_weight="1">


                <ImageView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="8dp"
                    android:layout_weight=".5"
                    android:src="@drawable/password" />


                <EditText
                    android:id="@+id/A2_edt_passwd"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_weight="4.6"
                    android:ems="10"
                    android:hint="Enter Password"
                    android:inputType="textPassword"
                    android:padding="20dp" />

            </LinearLayout>

            <Button
                android:id="@+id/A2_r_btn_signup"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/A2_r_ll2"
                android:layout_centerHorizontal="true"
                android:layout_gravity="center"
                android:layout_marginTop="15dp"
                android:layout_weight=".8"
                android:background="@drawable/btn_background"
                android:onClick="fun_A2_btnlogin"
                android:text="Login" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/A2_r_btn_signup"
                android:layout_centerHorizontal="true"
                android:layout_gravity="center"
                android:layout_marginBottom="100dp"
                android:layout_marginTop="15dp"
                android:layout_weight="1"
                android:onClick="fun_A2_btnsignup"
                android:text="I don't have an account"
                android:textColor="@color/md_black_1000"
                android:textSize="20dp" />


        </LinearLayout>
    </ScrollView>


</RelativeLayout>

Minimum supported android version in jelly bean

My question is not duplicate of Unfortunately MyApp has stopped. How can I solve this? My problem is different from this because at the time of compilation of my project i have not got any type of crashes or error.

Thanks in advance.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Nitin
  • 1,280
  • 1
  • 13
  • 17

1 Answers1

2

I think your images are in drawable-v24 or some else folder move it to drawable folder and test again .

mostafa3dmax
  • 997
  • 7
  • 18