2017-08-20 2 views
0

Hallo starten machte ich eine App und es funktioniert perfekt auf vielen Geräten aber in einigen Geräten Hauptbildschirm funktioniert nicht, und Anmelden Aktivität bei der Auswahl der App gibt Fehler und leider stoppt.Android App Fehler Unable Aktivität ComponentInfo

ich bin mit 15minSDK 26TargetedSdk und 26Use Compile SDK

unten ist mein logcat für Fehler. freundlich jemand helfen danke :)

08-20 11:16:57.007 21625-21625/com.jeffysmak.blooddonationpk 
E/AndroidRuntime: FATAL EXCEPTION: main 
                       Process: com.jeffysmak.blooddonationpk, PID: 21625 
                       java.lang.RuntimeException: Unable to start activity 
ComponentInfo{com.jeffysmak.blooddonationpk/com.jeffysmak.blooddonationpk.UserRegister}: 
android.view.InflateException: Binary XML file line #9: Error 
inflating class ImageView 
                        at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219) 
                        at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269) 
                        at android.app.ActivityThread.access$800(ActivityThread.java:135) 
                        at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
                        at android.os.Handler.dispatchMessage(Handler.java:102) 
                        at android.os.Looper.loop(Looper.java:136) 
                        at android.app.ActivityThread.main(ActivityThread.java:5045) 
                        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:779) 
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
                        at dalvik.system.NativeStart.main(Native Method) 
                       Caused by: android.view.InflateException: Binary XML file line #9: 
Error inflating class ImageView 
                        at 
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713) 
                        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
                        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 
com.jeffysmak.blooddonationpk.UserRegister.onCreate(UserRegister.java:95) 
                        at android.app.Activity.performCreate(Activity.java:5231) 
                        at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 
                        at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2163) 
                        at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)  
                        at android.app.ActivityThread.access$800(ActivityThread.java:135)  
                        at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)  
                        at android.os.Handler.dispatchMessage(Handler.java:102)  
                        at android.os.Looper.loop(Looper.java:136)  
                        at android.app.ActivityThread.main(ActivityThread.java:5045)  
                        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:779)  
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)  
                        at dalvik.system.NativeStart.main(Native Method)  
                       Caused by: android.content.res.Resources$NotFoundException: Resource 
is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f02008a a=-1 
r=0x7f02008a} 
                        at android.content.res.Resources.loadDrawable(Resources.java:2068) 
                        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:60) 
                        at 
android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:56) 
                        at 
android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106) 
                        at 
android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1026) 
                        at 
android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1083) 
                        at 
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:684) 
                        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)  
                        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 
com.jeffysmak.blooddonationpk.UserRegister.onCreate(UserRegister.java:95)  
                        at android.app.Activity.performCreate(Activity.java:5231)  
                        at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)  
                        at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2163)  
                        at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)  
                        at android.app.ActivityThread.access$800(ActivityThread.java:135)  
                        at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)  
                        at android.os.Handler.dispatchMessage(Handler.java:102)  
                        at android.os.Looper.loop(Looper.java:136)  
                        at android.app.ActivityThread.main(ActivityThread.java:5045)  
                        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:779)  
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)  
                        at dalvik.system.NativeStart.main(Native Method)  08-20 11:17:01.003 
21625-21653/com.jeffysmak.blooddonationpk W/DynamiteModule: Local 
module descriptor class for com.google.firebase.auth not found. 

meine Aktivität xml.

<?xml version="1.0" encoding="utf-8"?> 
<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="@drawable/splash" 
    tools:context="com.jeffysmak.blooddonationpk.UserRegister"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:padding="16dp"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:focusableInTouchMode="true" 
      android:orientation="vertical"> 


      <TextView 
       android:id="@+id/a" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:layout_margin="10dp" 
       android:text="REGISTRATION" 
       android:textColor="@color/colorPrimaryOrange" 
       android:textSize="18sp" 
       android:textStyle="bold" /> 

      <TextView 
       android:id="@+id/b" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/a" 
       android:layout_gravity="center" 
       android:text="All Feilds are required *" 
       android:textAllCaps="true" 
       android:textColor="#fff" /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_below="@+id/b" 
       android:layout_marginLeft="10dp" 
       android:layout_marginRight="10dp" 
       android:layout_marginTop="30dp" 
       android:orientation="vertical"> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/thumba" 
         android:layout_width="35dp" 
         android:layout_height="35dp" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:src="@drawable/user" 
         android:tint="#fff" /> 

        <EditText 
         android:id="@+id/user_Name" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:layout_marginBottom="20dp" 
         android:layout_toRightOf="@id/thumba" 
         android:backgroundTint="#fff" 
         android:cursorVisible="true" 
         android:hint="Name" 
         android:textColor="@color/colorPrimaryOrange" 
         android:textColorHint="#fff" /> 
       </RelativeLayout> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/thumbaq" 
         android:layout_width="35dp" 
         android:layout_height="35dp" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:src="@drawable/new_email_outline" 
         android:tint="#fff" /> 

        <EditText 
         android:id="@+id/user_email" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:layout_marginBottom="20dp" 
         android:layout_toRightOf="@id/thumbaq" 
         android:backgroundTint="#fff" 
         android:cursorVisible="true" 
         android:hint="Email" 
         android:inputType="textEmailAddress" 
         android:textColor="@color/colorPrimaryOrange" 
         android:textColorHint="#fff" /> 
       </RelativeLayout> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/thumbb" 
         android:layout_width="35dp" 
         android:layout_height="35dp" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:src="@drawable/password" 
         android:tint="#fff" /> 

        <EditText 
         android:id="@+id/user_Password" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:layout_marginBottom="20dp" 
         android:layout_toRightOf="@id/thumbb" 
         android:backgroundTint="#fff" 
         android:hint="Password" 
         android:inputType="textPassword" 
         android:textColor="@color/colorPrimaryOrange" 
         android:textColorHint="#fff" /> 

       </RelativeLayout> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/thumbc" 
         android:layout_width="35dp" 
         android:layout_height="35dp" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:src="@drawable/contactus" /> 

        <EditText 
         android:id="@+id/user_Contact" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:layout_marginBottom="20dp" 
         android:layout_toRightOf="@id/thumbc" 
         android:backgroundTint="#fff" 
         android:hint="Phone Number" 
         android:inputType="number" 
         android:textColor="@color/colorPrimaryOrange" 
         android:textColorHint="#fff" /> 

       </RelativeLayout> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/thumbd" 
         android:layout_width="35dp" 
         android:layout_height="35dp" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:src="@drawable/facebook_placeholder_for_locate_places_on_maps" 
         android:tint="#fff" /> 


        <Spinner 
         android:id="@+id/Reg_City" 
         android:layout_width="match_parent" 
         android:layout_height="40dp" 
         android:layout_centerVertical="true" 
         android:layout_margin="10dp" 
         android:layout_toRightOf="@id/thumbd" 
         android:backgroundTint="#fff" 
         android:textColor="@color/colorPrimaryOrange"> 

        </Spinner> 

       </RelativeLayout> 

       <Button 
        android:id="@+id/RegisterBTN" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_margin="15dp" 
        android:layout_marginBottom="20dp" 
        android:background="@drawable/btn" 
        android:text="REGISTER" 
        android:textColor="#fff" /> 


      </LinearLayout> 
     </LinearLayout> 


    </ScrollView> 

</RelativeLayout> 
+0

Bitte senden Sie das xml für Ihre Tätigkeit zu ersetzen –

+0

Dank für die Antwort :) Ich meine Post mit XML-Code meiner Tätigkeit bearbeiten. –

+0

Kasse Bitte diese Antwort: https://stackoverflow.com/a/35267520/5402482 Dies wird Ihnen –

Antwort

-1

In Ihrer Relative Layout die Größe Ihres ziehbar oder die Auflösung des ziehbar ist zu groß, zu handhaben.

Versuchen Sie ziehbar mit einer kleineren Version des Bildes in android:background="@drawable/splash"

+0

Ich habe versucht, ohne Hintergrundbild, aber denselben Fehler :( –

+0

und Das gleiche Bild funktioniert gut in meiner Splash-Aktivität ..... –

Verwandte Themen