# undefinierbarer Fehler Android



## Panda9296 (18. Aug 2020)

Hi Leute. Diesmal was für Profis: Ich sitze seit 10 Tagen dran... Mein Lehrer ist gescheitert...ich scheitere Tag für Tag mehr... mies:
Es geht darum, dass nach einem Update von Android Studios das gesamte Projekt gecrashed ist und sowas wie ein Totalschaden angerichtet hat...Einfache Zuweisungen in XML wurden vom Compoiler falsch angestrichen.. XML hat nicht mehr gepasst ect. p.p.
Ich habe ein neues Projekt angelegt, habe versucht zu retten was zu retten ist und habe ergäntzt was zu ergänzen geht. Teilerfolg... Es ist einigermaßen beisammen nur habe ich eine Fehlermeldung, die einfach weit über meine Kenntnisse hinausgehen Hier ist die Fehlermeldung(Hinweis: So wie der Code beschrieben ist, hat dieser vor dem Crash einwandfrei funktioniert)



> E/AndroidRuntime: FATAL EXCEPTION: main
> Process: de.miguel.frozzenlist.frozzenlistapp, PID: 30645
> java.lang.RuntimeException: Unable to start activity ComponentInfo{de.miguel.frozzenlist.frozzenlistapp/de.miguel.frozzenlist.frozzenlistapp.Register}: android.view.InflateException: Binary XML file line #46 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Binary XML file line #46 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Error inflating class EditText
> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3356)
> ...



Ich werde leider Gottes das komplette Projekt hier mal zur Verfügung stellen, oh man^^,


```
package de.miguel.frozzenlist.frozzenlistapp;

import java.util.ArrayList;

/**
 =============================================
 @author Miguel Gutierrez, project FrozzenList
 @version 1.0Beta

 Creates a new Freezer Object

 =============================================

 */

public class Freezer {

    private String name;
    public int tray;
    private ArrayList<Tray> trays;



    public Freezer(String name, int tray) {
        this.name = name;
        this.tray=tray;
        trays= new ArrayList<Tray>();
        for(int i= 0;i<tray;i++){
            trays.add(new Tray());
        }
    }
    public String getName(){
        return name;
    }


    @Override
    public String toString() {
        return  name +" hat " + tray +" Fächer";
    }

}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

/**
    ========================================================================
    @author Miguel Gutierrez, project FrozzenList
    @version 1.0Beta
    @param : freezer: addFreezer(), removeFreezer(), getFrezzer()
           To add Freezer we need to have number of Trays and a frezzer name
           We need to set a error information in editText field for Exceptions
           (parsing)we include to join a frezzermember on the same Activity
     @link Hawk freezerList to save freezer for Account
    ========================================================================

 */

public class FreezerManagment extends AppCompatActivity {

    EditText inputName;
    EditText inputNumberTrays;
    Button addFreezer;
    RecyclerView recyclerView;
    RecyclerViewAdapter recyclerViewAdapter;
    UserManager userManager;
    int position;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_freezer_manager);
        userManager= new UserManager(this);
        position= getIntent().getIntExtra("position",0);
        inputName = (EditText) findViewById(R.id.editTextName);
        inputNumberTrays = (EditText) findViewById(R.id.editTextNumberTray);
        addFreezer = (Button) findViewById(R.id.btnAdd);
        recyclerView= findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerViewAdapter= new RecyclerViewAdapter(position,userManager);
        recyclerView.setAdapter(recyclerViewAdapter);
        ItemTouchHelper itemTouchHelper= new ItemTouchHelper(new TouchCallBack(userManager,position,recyclerView));
        itemTouchHelper.attachToRecyclerView(recyclerView);


        addFreezer.setOnClickListener(new View.OnClickListener() {
            @RequiresApi(api = Build.VERSION_CODES.KITKAT)
            @Override
            public void onClick(View view) {
                FreezerManagment.this.onButtonClick();
            }
        });
    }

    void onButtonClick(){
        userManager.getUserList().get(position).freezers.add(new Freezer(inputName.getText().toString(),Integer.parseInt(inputNumberTrays.getText().toString())));

        recyclerView.getAdapter().notifyItemInserted(userManager.getUserList().get(position).freezers.size()-1);
    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;

import java.io.Serializable;
import java.util.ArrayList;

public class LoginActivityMain extends Activity {

    Button btnRegister;
    Button btnSignIn;
    EditText inputEmail;
    EditText inputPasswort;

    ArrayList<Serializable> userArrayList= new ArrayList<java.io.Serializable>();


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_main);

        inputEmail= (EditText)findViewById(R.id.username);
        inputPasswort= (EditText)findViewById(R.id.password);

        //register condition
        btnRegister= (Button)findViewById(R.id.btnRegisterMain);
        btnRegister.setOnClickListener(view -> registerClick());

        // sign in condition
        btnSignIn= (Button)findViewById(R.id.btnLogin);
        btnSignIn.setOnClickListener(view -> signInClick());
    }
    void signInClick(){
        Log.d("MainActivity","test");
        String userEmail = inputEmail.getText().toString();
        String passwort = inputPasswort.getText().toString();
        if(userEmail.isEmpty()) {
            inputEmail.setError("Bitte Email eingeben");
            inputEmail.requestFocus();
        }
        else if(passwort.isEmpty()){
            inputPasswort.setError("Bitte Passwort eingeben");
            inputPasswort.requestFocus();
        }
        if(userEmail.isEmpty()&&passwort.isEmpty()) {

            UserManager userManager= new UserManager(this);
            User user= new User(passwort,userEmail);
            for(int i = 0; i< userManager.getUserList().size(); i++){

                User compareUser= (User) userManager.getUserList().get(i);
                Log.d("MainActivity", compareUser.getUserName());
                if(compareUser.getEmail().equals(user.getEmail())&&compareUser.getPasswort().
                        equals(user.getPasswort())){
                 Log.d("MainACtivity",compareUser.getEmail());
                    Intent intent= new Intent(LoginActivityMain.this, FreezerManagment.class);
                    intent.putExtra("position", i);
                    startActivity(intent);
                }
            }
        }
    }
    //register button
    void registerClick(){
        Intent intent = new Intent(LoginActivityMain.this,Register.class);
        startActivity(intent);

    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

import android.os.Build;

import androidx.annotation.RequiresApi;

import java.time.LocalDate;
import java.util.Objects;

/**
 =================================================================================================
 @author Miguel Gutierrez, project FrozzenList
 @version 1.0Beta
 @param: Object initialize Product: Attributs: name,(variable)ProductID,FrozzenDate:Expirationdate
 to set date memory.
 @link Tray
 ================================================================================================
 */
public class Product {

    private String name;
    private double amount;
    private int pieces;
    private int durability;
    LocalDate frozzenDate;
    LocalDate frozzenDateAfter;


    //Instance
    @RequiresApi(api = Build.VERSION_CODES.O)
    public Product(String name, double amount, int pieces,  int durability) {
        this.name = name;
        this.amount=amount;
        this.pieces=pieces;
        this.frozzenDate= frozzenDate.now();
        this.durability=durability;

    }
    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
    public double getAmount() {
        return amount;
    }
    public void setAmount(double amount) {
        this.amount = amount;
    }
    public double getPieces() {
        return pieces;
    }

    public void setPieces(int pieces) {
        this.pieces = pieces;
    }
    public double amoutSum(){
        return amount= amount*(double)pieces;
    }
    public void setDurability(){
        this.durability=durability;
    }
    public int getDurability() {
        return durability;
    }

    @RequiresApi(api = Build.VERSION_CODES.O)
    public LocalDate setFrozzenDateAfter(){
        frozzenDateAfter = frozzenDate.plusMonths(durability);
        return frozzenDateAfter;
    }
    @Override
    public String toString() {
        return "Product [name=" + name + ", ProductID="   +"]";
    }


}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

import android.content.Intent;
import android.os.Build;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;

/**
 * =================================================================================================
 * @author Miguel Gutierrez, FrozzenList Project
 * Creates RecyclerViewAdapter for drag and drop list to show datalsit
 * Creates Usermanager for sending Userdata to RecyclerViewAdapter for setting Touchcallback and
 * sweapsiteattitude. Adapter for putting Object into List
 * @param: positition: position from userlist to getUser in userList and to get position from Freezer
 * @param: freezer_row: cellrecyling for performance
 * @param: Adapter<ViewHolder> which viewHolder for use Adapter</ViewHolder>=>RecylerViewHolder
 * =================================================================================================
 *
 */

public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {

    int position;
    UserManager userManager;

    public RecyclerViewAdapter(int position, UserManager userManager){
        this.position=position;
        this.userManager= userManager;
    }


    // For one cell from parent context:call by create cell(new ViewHolder)==>return viewHolder from freezerRow:
    //viewholder need the object from row with LayoutInflater  #matchparent: height like parent class

    /**
     *
     * @param parent: ViewGroup
     * @param viewType: add inflate to freezer_row
     * @return reezer_row Layout: false==> because android should perform the action automatically
     */

    @Override
    public RecyclerViewAdapter.ViewHolder onCreateViewHolder( ViewGroup parent, int viewType) {
        return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.freezer_row,
                parent,false));
    }

    /**
     *
     * @param holder transfer attributs to View
     * @param position attributs by freezer: need userManager for userinformation and freezerlist:
     *                 call by position
     */


    @Override
    public void onBindViewHolder( ViewHolder holder, int position) {

        holder.textView.setText(userManager.getUserList().get(position).freezers.get(position).getName()+
                     " hat "+ userManager.getUserList().get(position).freezers.get(position).tray+ " Fächer");

    }

    /**
     *  how many items to use
     * @return freezer size
     */

    @Override
    public int getItemCount() {
        Log.d("onButtonClick",String.valueOf(userManager.getUserList().get(position).freezers.size()));
        return userManager.getUserList().get(position).freezers.size();
    }

    /**
     *  Viewholder as Memberclass
     */
    public class ViewHolder extends RecyclerView.ViewHolder {

        TextView textView;

        public ViewHolder(View itemView) {
            super(itemView);
            textView=itemView.findViewById(R.id.textLayout);
            itemView.setOnClickListener(new View.OnClickListener() {
                @RequiresApi(api = Build.VERSION_CODES.KITKAT)
                @Override
                public void onClick(View view) {
                   Intent intent = new Intent(view.getContext(),TrayManager.class);
                   userManager.getUserList().get(position).freezers.get(getAdapterPosition());
                    view.getContext().startActivity(intent);
                }
            });

        }
    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

/**
 ==========================================================================================
 @author Miguel Gutierrez, project FrozzenList
 @version 1.0Beta
 @param: register User: name,email,passwort(and to controlPasswort to ckeck passwortinput)
 UserManager to save user data,
 @link MainActivity(loginscreen)= intent
 ==========================================================================================
 */
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;


public class Register extends AppCompatActivity {

    Button regristryFinish;
    EditText inputName;
    EditText inputEmail;
    EditText setPasswort;
    EditText setControlPasswort;
    User user;
    UserManager userManager;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.register);

        regristryFinish=(Button)findViewById(R.id.btnRegistry);

        inputName= (EditText)findViewById(R.id.bntInputName);
        inputEmail=(EditText)findViewById(R.id.bntInputEmail);
        setPasswort=(EditText)findViewById(R.id.bntsetPasswort);
        setControlPasswort=(EditText)findViewById(R.id.bntControlPasswort);

        userManager= new UserManager(this);
        regristryFinish.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Register.this.onFinishClick();
            }
        });


    }

    void onFinishClick() {

        String newUser = inputName.getText().toString();
        String newEmail = inputEmail.getText().toString();
        String newPasswort = setPasswort.getText().toString();
        String newPasswortCommit = setControlPasswort.getText().toString();

        if (newPasswort.equals(newPasswortCommit) && newEmail.length() > 0) {

            user = new User(newEmail, newPasswort);

            if (newPasswort.equals(newPasswortCommit) && newUser.length() > 0 && newEmail.length() > 0) {

                user = new User(newPasswort, newEmail);

                userManager.addUser(user);

                Intent loginScreen = new Intent(Register.this, LoginActivityMain.class);
                startActivity(loginScreen);


            }
        }
    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

/**
 * Creates a Callback for the given drag and swipe allowance. These values serve as
 * defaults
 * and if you want to customize behavior per ViewHolder, you can override
 * {@link #:getSwipeDirs(RecyclerView, ViewHolder)}
 * and / or {@link #:getDragDirs(RecyclerView, ViewHolder)}.
 *
 * @param: dragDirs  Binary OR of direction flags in which the Views can be dragged. Must be
 *                  composed of {@link #:LEFT}, {@link #:RIGHT}, {@link #:START}, {@link
 *                  #:END},
 *                  {@link #:UP} and {@link #:DOWN}.
 * @param: swipeDirs:Binary OR of direction flags in which the Views can be swiped. Must be
 *                  composed of {@link #:LEFT}, {@link #:RIGHT}, {@link #:START}, {@link
 *                  #:END},
 *                  {@link #:UP} and {@link #:DOWN}.
 */

import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;

public class TouchCallBack extends ItemTouchHelper.SimpleCallback {


    UserManager userManager;
    int position;
    RecyclerView recyclerView;

    public TouchCallBack(UserManager userManager,int position,RecyclerView recyclerView) {
        super(ItemTouchHelper.DOWN|ItemTouchHelper.UP, ItemTouchHelper.LEFT|ItemTouchHelper.RIGHT);
        this.userManager= userManager;
        this.position=position;
        this.recyclerView=recyclerView;

    }


    @Override
    public boolean onMove(RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder,
                          RecyclerView.ViewHolder target) {
        Freezer freezer= userManager.getUserList().get(position).freezers.get(viewHolder.getAdapterPosition());
        int oldPosition= viewHolder.getAdapterPosition();
        int newPosition= target.getAdapterPosition();
        userManager.getUserList().get(position).freezers.remove(oldPosition);
        userManager.getUserList().get(position).freezers.add(newPosition,freezer);
        userManager.saveList();
        recyclerView.getAdapter().notifyItemMoved(oldPosition,newPosition);
        return true;
    }


    @Override
    public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
        userManager.loadList();
        userManager.getUserList().get(position).freezers.remove(viewHolder.getAdapterPosition());
        recyclerView.getAdapter().notifyItemRemoved(viewHolder.getAdapterPosition());
        userManager.saveList();
    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

import java.util.ArrayList;
import java.util.HashMap;

/**  ===========================================================================
 @author Miguel Gutierrez, project FrozzenList
 @version 1.0Beta
 @param: get Key producttype to add Product, remove Product , change Product,
 producttype add manually: addProduct ,remove Product
 @link Freezer
 ===========================================================================
 */

public class Tray {

    private HashMap<String, ArrayList<Product>> producttypes = new HashMap<>();
    //Instance
    public Tray() {

        producttypes.put("Vegetables", new ArrayList<Product>());
        producttypes.put("Beef", new ArrayList<Product>());         //Meat variety
        producttypes.put("Pork", new ArrayList<Product>());
        producttypes.put("Poultry", new ArrayList<Product>());
        producttypes.put("Calf", new ArrayList<Product>());
        producttypes.put("Lamb", new ArrayList<Product>());
        producttypes.put("Vinison", new ArrayList<Product>());      //other typs
        producttypes.put("Fruit", new ArrayList<Product>());
        producttypes.put("Ice", new ArrayList<Product>());
        producttypes.put("Sauces", new ArrayList<Product>());
        producttypes.put("Meals", new ArrayList<Product>());
        producttypes.put("other", new ArrayList<Product>());
    }

    protected void producttypeAdd(String value) {
        if (!producttypes.containsKey(value)) {
            producttypes.put(value, new ArrayList<Product>());
        }
        else{
            //Toast
        }
    }

    public String getHashList(Product product) {
        for (int i = 0; i < producttypes.size(); i++) {
            return producttypes.toString();
        }return null;
    }
    public void addProduct(Product product,String value){


        if (producttypes.containsKey(value)) {
            producttypes.get(value).add(product);
        }
        else{
            producttypeAdd(value);
            addProduct(product,value);
        }
    }
    public void removeProduct(String value, Product product) {
        if(producttypes.containsKey(value)&&producttypes.equals(product)){
            producttypes.get(value).remove(product);
        }else {
            //Toast: no product to remove
        }
    }
    public void changeProduct(String value,Product product) {
        if(producttypes.containsKey(value)&&producttypes.containsValue(product)) {
            producttypes.get(value).remove(product);
            producttypes.get(value).add(product);
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tray tray = (Tray) o;
        return producttypes.equals(tray.producttypes);
    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;

import java.io.Serializable;
import java.util.ArrayList;

/**
 =============================================================================================
 @author Miguel Gutierrez, project FrozzenList
 @version 1.0Beta
 @param: conntent UserObject: Attributs:name,passwort,email:option to change Passwort
 in a other Activity, optional:link for email
 @link MainActivity,UserManager,Registry
 =============================================================================================
 */

public class User implements Serializable {


    private String userName;
    private String passwort;
    private String email;
    ArrayList<Freezer>freezers;


    public User(String passwort,String email){
        this.passwort=passwort;
        this.email=email;
        if(freezers==null){
            freezers=new ArrayList<>();
        }

        //for login

    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPasswort() {
        return passwort;
    }
    public void setPasswort(String passwort) {
        this.passwort=passwort;
    }
    public String getEmail(){
        return email;
    }
    public void setEmail(String inputEmail){
        this.email=inputEmail;
    }
    public void changePasswort(String input)
    {
        this.passwort= input;
    }
}
```


```
package de.miguel.frozzenlist.frozzenlistapp;


import android.content.Context;

import com.orhanobut.hawk.Hawk;

import java.util.ArrayList;

/**
 ==============================================================
 @author Miguel Gutierrez, project FrozzenList
 @version 1.0Beta
 @param: save Userunit: Hawk to saveList,loadList and addUser
 @Link userManager
 ==============================================================
 */

public class UserManager {

    private ArrayList<User> userList;

    //Instance
    public UserManager(Context context){
        Hawk.init(context).build();
        loadList();

    }

    public void saveList(){

     /*   try {
            OutputStream outputStream= new FileOutputStream(new File("userList.txt"));
            ObjectOutputStream objectOutputStream= new ObjectOutputStream(outputStream);
            objectOutputStream.writeObject(userList);
            objectOutputStream.flush();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }*/

        Hawk.put("userList", userList);

    }
    public void loadList(){

      /*  try{
            InputStream inputStream=new FileInputStream("userList.txt");
            ObjectInputStream objectInputStream= new ObjectInputStream(inputStream);
            userList= (ArrayList<User>) objectInputStream.readObject();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }*/
       userList= Hawk.get("userList",new ArrayList<User>());

    }
    public void addUser(User user){
        getUserList().add(user);
        saveList();
    }
    public void removeUser(int position){
        getUserList().remove(position);
        saveList();
    }

    public ArrayList<User> getUserList() {
        return userList;
    }

    public void setUserList(ArrayList<User> userList) {
        this.userList = userList;
    }
}
```
 Das sind die allgemeinen Klassen. Ich möchte wenn es wieder geht auf eine file speichern^^- Deswegen sind diese in Kommentare hinterlegt.


```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    
 
    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:padding="@dimen/freezer_linearLayout_padding"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/images"
    android:weightSum="100"
    android:orientation="vertical"
    >
    
    <TextView
        android:layout_width="match_parent"
        android:layout_height="@dimen/freezer_textView_layout_height"
        android:text="@string/freezerAdd"
        android:textSize="@dimen/freezer_textView_layout_textSize"/>

    <EditText
        android:id="@+id/editTextName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/name"
        android:inputType="textPersonName"
        android:autofillHints="" />


    <EditText
        android:id="@+id/editTextNumberTray"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/anzahl_der_f_cher"
        android:inputType="numberDecimal"
        android:autofillHints="" />
    


     <Button
         android:id="@+id/btnAdd"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/hinzuf_gen"
         android:layout_gravity="center"
        />

    <androidx.recyclerview.widget.RecyclerView
        tools:listitem="@layout/freezer_row"
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="100"
        android:layout_marginBottom="@dimen/freezer_recyclerview_marginBottom"/>





</LinearLayout>
```


```
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:background="@drawable/images">

    <EditText
        android:id="@+id/username"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginTop="96dp"
        android:layout_marginEnd="24dp"
        android:hint="@string/prompt_email"
        android:inputType="textEmailAddress"
        android:selectAllOnFocus="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/password"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="24dp"
        android:hint="@string/prompt_password"
        android:imeActionLabel="@string/action_sign_in_short"
        android:imeOptions="actionDone"
        android:inputType="textPassword"
        android:selectAllOnFocus="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/username" />

    <Button
        android:id="@+id/btnLogin"
        android:layout_width="300dp"
        android:layout_height="75dp"
        android:layout_gravity="start"
        android:layout_marginStart="48dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="48dp"
        android:layout_marginBottom="64dp"
        android:enabled="true"
        android:text="@string/action_sign_in_short"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/password"
        app:layout_constraintVertical_bias="0.2" />
    <Button
        android:id="@+id/btnRegisterMain"
        android:layout_width="300dp"
        android:layout_height="75dp"
        android:layout_gravity="start"
        android:layout_marginStart="48dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="48dp"
        android:layout_marginBottom="200dp"
        android:enabled="true"
        android:text="@string/action_register"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btnLogin"
        app:layout_constraintVertical_bias="0.2" />

    <ProgressBar
        android:id="@+id/loading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginStart="@dimen/activity_main_constraitlayout_widget_layout_marginStart"
        android:layout_marginTop="@dimen/activity_main_constraitlayout_widget_layout_marginTop"
        android:layout_marginEnd="@dimen/activity_main_constraitlayout_widget_layout_marginEnd"
        android:layout_marginBottom="@dimen/activity_main_constraitlayout_widget_layout_marginBottom"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="@+id/password"
        app:layout_constraintStart_toStartOf="@+id/password"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.3" />
</androidx.constraintlayout.widget.ConstraintLayout>
```


```
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/textLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="Miguel mag xml"
        android:textSize="@dimen/activity_freezer_row_layout_textView_textSize"
        android:textColor="#000000"
        android:gravity="center"/>



</androidx.constraintlayout.widget.ConstraintLayout>
```


```
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/images"
    tools:context=".Register">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/constraintLayout"
        android:layout_width="@dimen/activity_register_constraintlayout_widget_constraintLayout_width"
        android:layout_height="@dimen/activity_register_constraintlayout_widget_constraintLayout_height"
        android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_constraintLayout_marginEnd"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.4">

        <Button
            android:id="@+id/btnRegistry"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginEnd="8dp"
            android:layout_marginBottom="32dp"
            android:text="@string/regristrieren"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/btnCanellation"
            app:layout_constraintTop_toBottomOf="@+id/bntControlPasswort" />

        <Button
            android:id="@+id/btnCanellation"
            android:layout_width="@dimen/activity_register_constraintlayout_widget_Button_cancel_width"
            android:layout_height="@dimen/activity_register_constraintlayout_widget_Button_cancel_height"
            android:layout_marginStart="@dimen/activity_register_constraintlayout_widget_Button_cancel_marginStart"
            android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_Button_cancel_marginEnd"
            android:onClick="Register"
            android:text="@string/abbruch"
            app:layout_constraintBottom_toBottomOf="@+id/btnRegistry"
            app:layout_constraintEnd_toStartOf="@+id/btnRegistry"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/btnRegistry"
            tools:ignore="OnClick" />

        <EditText
            android:id="@+id/bntInputName"
            android:layout_width="@dimen/activity_register_constraintlayout_widget_editText_inputName_width"
            android:layout_height="@dimen/activity_register_constraintlayout_widget_editText_inputName_heigth"
            android:layout_marginStart="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginStart"
            android:layout_marginTop="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginTop"
            android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginEnd"
            android:layout_marginBottom="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginBottom"
            android:ems="@dimen/activity_register_constraintlayout_widget_editText_inputName_ems"
            android:hint="@string/name"
            android:importantForAutofill="no"
            android:inputType="textPersonName"
            app:layout_constraintBottom_toTopOf="@+id/bntInputEmail"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <EditText
            android:id="@+id/bntInputEmail"
            android:layout_width="@dimen/activity_register_constraintlayout_widget_editText_inputEmail_width"
            android:layout_height="@dimen/activity_register_constraintlayout_widget_editText_inputEmail_heigth"
            android:layout_marginStart="@dimen/activity_register_constraintlayout_widget_editText_inputEmail_marginStart"
            android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_editText_inputEmail_marginEnd"
            android:layout_marginBottom="@dimen/activity_register_constraintlayout_widget_editText_inputEmail_marginBottom"
            android:autofillHints=""
            android:ems="10"
            android:hint="@string/hint_mail"
            android:inputType="textEmailAddress"
            app:layout_constraintBottom_toTopOf="@+id/bntsetPasswort"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/bntInputName" />

        <EditText
            android:id="@+id/bntsetPasswort"
            android:layout_width="@dimen/activity_register_constraintlayout_widget_editText_inputPasswort_width"
            android:layout_height="@dimen/activity_register_constraintlayout_widget_editText_inputPasswort_heigth"
            android:layout_marginStart="@dimen/activity_register_constraintlayout_widget_editText_inputPasswort_marginStart"
            android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_editText_inputPasswort_marginEnd"
            android:layout_marginBottom="@dimen/activity_register_constraintlayout_widget_editText_inputPasswort_marginBottom"
            android:autofillHints=""
            android:ems="@dimen/activity_register_constraintlayout_widget_editText_inputPasswort_ems"
            android:hint="@string/hint_passwort"
            android:inputType="textPassword"
            app:layout_constraintBottom_toTopOf="@+id/bntControlPasswort"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/bntInputEmail" />

        <EditText
            android:id="@+id/bntControlPasswort"
            android:layout_width="@dimen/activity_register_constraintlayout_widget_editText_passwortControl_width"
            android:layout_height="@dimen/activity_register_constraintlayout_widget_editText_passwortControl_heigth"
            android:layout_marginStart="@dimen/activity_register_constraintlayout_widget_editText_passwortControl_marginStart"
            android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_editText_passwortControl_marginEnd"
            android:layout_marginBottom="@dimen/activity_register_constraintlayout_widget_editText_passwortControl_marginBottom"
            android:ems="@dimen/activity_register_constraintlayout_widget_editText_passwortControl_ems"
            android:hint="@string/hint_passwort"
            android:importantForAutofill="no"
            android:inputType="textPassword"
            app:layout_constraintBottom_toTopOf="@+id/btnRegistry"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/bntsetPasswort" />



    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
```

Ich bekomme den Gedanken nicht los, dass es am Manifest liegt .... 

Hier ist es ...

```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="de.miguel.frozzenlist.frozzenlistapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="LoginActivityMain"
            tools:ignore="DuplicateActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Register">

        </activity>
    </application>

</manifest>
```

Die Exception wurde ausgelöst, als ich einen Nutzer regristrieren wollte ... ich werde euch auch mal das Grandle zur Verfügung stellen, vielleicht habe ich als Anfänger hier was verwurschtelt ...

```
apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "de.miguel.frozzenlist.frozzenlistapp"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.2.0-alpha04'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'com.orhanobut:hawk:2.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
```

allerdings glaube ich das nicht... Bin nach 10 Tagen und 15h Arbeit jeden Tag daran an einem "verzweifelten Punkt". Wie kann ich sowas lösen ^^ wie kann ich an solche Fehlermeldungen ran gehen? Gibt es eine Lösung?


----------



## mrBrown (18. Aug 2020)

Welches ist denn die fehlerhafte Datei (und welches ist Zeile 46 darin?):


Panda9296 hat gesagt.:


> ```
> Caused by: android.view.InflateException: Binary XML file line #46 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Error inflating class EditText
> Caused by: java.lang.NumberFormatException: For input string: "10.0"
> ```


----------



## Panda9296 (18. Aug 2020)

Ok also es ist die Registerklasse und es ist das Register Layout Zeile 46 ist ein Edittextfeld...

```
<EditText
            android:id="@+id/bntInputName"
            android:layout_width="@dimen/activity_register_constraintlayout_widget_editText_inputName_width"
            android:layout_height="@dimen/activity_register_constraintlayout_widget_editText_inputName_heigth"
            android:layout_marginStart="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginStart"
            android:layout_marginTop="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginTop"
            android:layout_marginEnd="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginEnd"
            android:layout_marginBottom="@dimen/activity_register_constraintlayout_widget_editText_inputName_marginBottom"
            android:ems="@dimen/activity_register_constraintlayout_widget_editText_inputName_ems"
            android:hint="@string/name"
            android:importantForAutofill="no"
            android:inputType="textPersonName"
            app:layout_constraintBottom_toTopOf="@+id/bntInputEmail"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
```
 Zeile 46 ist "<EditText"


----------



## mrBrown (18. Aug 2020)

Dann wären als nächstes die @dimen-Werte interessant  Steht dort irgendwo eine "10.0"?


----------



## Panda9296 (18. Aug 2020)

<dimen name= "activity_register_constraintlayout_widget_editText_inputName_ems">10</dimen>

wäre das einzigste was speziell dazu passen würde


----------



## mrBrown (18. Aug 2020)

Versuch mal `android:ems="10"` direkt statt `android:ems="@dimen/activity_register_constraintlayout_widget_editText_inputName_ems"`

EDIT: in dem EditText in Zeile 64


----------



## Panda9296 (18. Aug 2020)

```
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: de.miguel.frozzenlist.frozzenlistapp, PID: 30992
    java.lang.RuntimeException: Unable to start activity ComponentInfo{de.miguel.frozzenlist.frozzenlistapp/de.miguel.frozzenlist.frozzenlistapp.Register}: android.view.InflateException: Binary XML file line #79 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Binary XML file line #79 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Error inflating class EditText
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3356)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3500)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7523)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
     Caused by: android.view.InflateException: Binary XML file line #79 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Binary XML file line #79 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Error inflating class EditText
     Caused by: android.view.InflateException: Binary XML file line #79 in de.miguel.frozzenlist.frozzenlistapp:layout/register: Error inflating class EditText
     Caused by: java.lang.NumberFormatException: For input string: "10.0"
        at java.lang.Integer.parseInt(Integer.java:615)
        at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:141)
        at android.content.res.TypedArray.getInt(TypedArray.java:434)
        at android.widget.TextView.<init>(TextView.java:1213)
        at android.widget.EditText.<init>(EditText.java:87)
        at android.widget.EditText.<init>(EditText.java:83)
        at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:74)
        at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:69)
        at androidx.appcompat.app.AppCompatViewInflater.createEditText(AppCompatViewInflater.java:209)
        at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:127)
        at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
        at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
        at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1059)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:995)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
        at de.miguel.frozzenlist.frozzenlistapp.Register.onCreate(Register.java:36)
        at android.app.Activity.performCreate(Activity.java:7984)
        at android.app.Activity.performCreate(Activity.java:7973)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3329)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3500)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7523)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
I/Process: Sending signal. PID: 30992 SIG: 9
#
```


Ich glaube das hat gepasst... verstehe ich aber nicht das das Problem ist. Ist doch das Selbe^^


----------



## mrBrown (18. Aug 2020)

Panda9296 hat gesagt.:


> Ich glaube das hat gepasst...


Jetzt das gleiche noch am anderen EditText ändern 



Panda9296 hat gesagt.:


> verstehe ich aber nicht das das Problem ist. Ist doch das Selbe^^


Beim referenzieren auf resourcen finden vermutlich irgendwelche Konvertierungen statt, Dimensionen sind intern offensichtlich als Fliesßkommezahlen hinterlegt, nicht als Integer  




Panda9296 hat gesagt.:


> Wie kann ich sowas lösen ^^ wie kann ich an solche Fehlermeldungen ran gehen? Gibt es eine Lösung?


Immer zuerst den Stacktrace durchgucken. In dem Fall steht da der Hinweis auf die fehlerhafte Zeile, die Art des Fehlers und die Codestelle, an der die Exception geworfen wurde.

Da die XML-Datei angemeckert wird: die betreffende Zeile dort angucken: dort steht keine "10.0", aber es werden Werte referenziert, also mal die Dateien angucken.
Dort steht keine "10.0", aber immerhin eine "10" – möglicherweise passiert da ja irgendwo eine Konvertierung, also testweise mal direkt 10 statt der Referenz nutzen -> Fehler behoben.


----------



## Panda9296 (18. Aug 2020)

Jap da hab ich selbst schon probiert und bin weiter gekommen ich danke =) . Sind jetzt zwar wieder Fehler in der nächsten Activity. Aber ich denke ich komme jetzt klar... Ich wäre nie darauf gekommen. Ich hoffe, dass das mit der neuen Taktik besser funktioniert. Vielen lieben dank


----------

