Я новичок в Android Studio
Я изо всех сил пытаюсь построить этот проект
https://github.com/CodingInfinite/AndroidLoginScreen
Я получаю много ошибок, которые я исправил, но все ещеэто приложение не запускается
оно открывается и вылетает
это ошибки
07-07 00: 06: 02.063 8601-8601 / com.example.testdesign E / AndroidRuntime: ИСКЛЮЧИТЕЛЬНОЕ ИСКЛЮЧЕНИЕ: главный Процесс: com.example.testdesign, PID: 8601 java.lang.RuntimeException: Невозможно запустить действие ComponentInfo {com.example.testdesign / com.example.testdesign.MainActivity}: android.view.InflateException: строка двоичного файла XML # 78: строка двоичного файла XML # 78: ошибка надувания класса android.support.design.widget.TextInputEditText в android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2416) в android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2476) в android.app.ActivityThread.-wrap11 (ActivityThread.java) в android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1344) в android.os.Handler.dispatchMessage (хаndler.java:102) в android.os.Looper.loop (Looper.java:148) в android.app.ActivityThread.main (ActivityThread.java:5417) в java.lang.reflect.Method.invoke (собственный метод)на com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:726) на com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616). Вызывается: android.view.InflateException: бинарныйСтрока файла XML # 78: Строка файла двоичного XML # 78: Ошибка надувания класса android.support.design.widget.TextInputEditText в android.view.LayoutInflater.inflate (LayoutInflater.java:539) в android.view.LayoutInflater.inflate (LayoutInflater).java: 423) в android.view.LayoutInflater.inflate (LayoutInflater.java:374) в androidx.appcompat.app.AppCompatDelegateImpl.setContentView (AppCompatDelegateImpl.java:469) в androidx.appcompat.ompActionApp. CompApp. AppAcApp .AppJava: 140) на com.example.testdesign.MainActivity.onCreate (MainActivity.java:31) на android.app.Activity.performCreate (Activity.java:6237) на android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1107) в android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2369) в android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2476) в android.app.ActivityThread.-wrapActivityThread.java) в android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1344) в android.os.Handler.dispatchMessage (Handler.java:102) в android.os.Looper.loop (Looper.java:148) в android.app.ActivityThread.main (ActivityThread.java:5417) в java.lang.reflect.Method.invoke (собственный метод) в com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:726)) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616) Вызывается: android.view.InflateException: строка двоичного файла XML # 78: ошибка надувания класса android.support.design.widget.TextInputEditText на android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:776) в android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:704) в android.view.LayoutInflater.rInflate (LayoutInflater.java:835) в android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:798) в android.view.LayoutInflater.rInflate (LayoutInflater.java:838L) в android..rInflateChildren (LayoutInflater.java:798) в android.view.LayoutInflater.rInflate (LayoutInflater.java:838) в android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:798) в android.view.InfateJava: 515) на android.view.LayoutInflater.inflate (LayoutInflater.java:423)на android.view.LayoutInflater.inflate (LayoutInflater.java:374)
на androidx.appcompat.app.AppCompatDelegateImpl.setContentView (AppCompatDelegateImpl.java:469)
на androidx.appcompat.app.AppCompatActivity.setContentView (AppCompatActivity.java:140)
в com.example.testdesign.MainActivity.onCreate (MainActivity.java:31)
на android.app.Activity.performCreate (Activity.java:6237)
на android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1107)
на android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2369)
на android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2476)
на android.app.ActivityThread.-wrap11 (ActivityThread.java)
на android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1344)
на android.os.Handler.dispatchMessage (Handler.java:102)
на android.os.Looper.loop (Looper.java:148)
на android.app.ActivityThread.main (ActivityThread.java:5417)
в java.lang.reflect.Method.invoke (родной метод)
на com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:726)
на com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
Вызвано: java.lang.ClassNotFoundException: не найден класс «android.support.design.widget.TextInputEditText» на пути: DexPathList [[zip-файл »/data/app/com.example.testdesign-2/base.apk ", zip-файл" /data/app/com.example.testdesign-2/split_lib_dependencies_apk.apk ", zip-файл" /data/app/com.example.testdesign-2/split_lib_slice_0_apk.apk ", zip-файл" / data / app / com.example.testdesign-2 / split_lib_slice_1_apk.apk ", ZIP-файл" /data/app/com.example.testdesign-2/split_lib_slice_2_apk.apk ", ZIP-файл" /data/app/com.example.testdesign- 2 / split_lib_slice_3_apk.apk ", ZIP-файл" /data/app/com.example.testdesign-2/split_lib_slice_4_apk.apk ", ZIP-файл" /data/app/com.example.testdesign-2/split_lib_slice_5_apk.apk ", zip файл "/data/app/com.example.testdesign-2/split_lib_slice_6_apk.apk", ZIP-файл "/data/app/com.example.testdesign-2/split_lib_slice_7_apk.apk", ZIP-файл "/ data / app / com .example.testdesign-2 / split_lib_slice_8_apk.apk ", zip-файл" /data/app/com.example.testdesign-2/split_lib_slice_9_apk.apk"],n ativeLibraryDirectories = [/ data / app / com.example.testdesign-2 / lib / x86, / vendor / lib, / system / lib]]
в dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)
в java.lang.ClassLoader.loadClass (ClassLoader.java:511)
в java.lang.ClassLoader.loadClass (ClassLoader.java:469)
на android.view.LayoutInflater.createView (LayoutInflater.java:583)
на android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:764)
так что, видимо, ошибка здесь
![enter image description here](https://i.stack.imgur.com/zdt9l.png)
MainActivity.java
package com.example.testdesign;
import android.animation.Animator;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.ViewPropertyAnimator;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
public class MainActivity extends AppCompatActivity {
private ImageView bookIconImageView;
private TextView bookITextView;
private ProgressBar loadingProgressBar;
private RelativeLayout rootView, afterAnimationView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
initViews();
new CountDownTimer(5000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
bookITextView.setVisibility(GONE);
loadingProgressBar.setVisibility(GONE);
rootView.setBackgroundColor(ContextCompat.getColor(MainActivity.this, R.color.colorSplashText));
bookIconImageView.setImageResource(R.drawable.background_color_book);
startAnimation();
}
@Override
public void onFinish() {
}
}.start();
}
private void initViews() {
bookIconImageView = findViewById(R.id.bookIconImageView);
bookITextView = findViewById(R.id.bookITextView);
loadingProgressBar = findViewById(R.id.loadingProgressBar);
rootView = findViewById(R.id.rootView);
afterAnimationView = findViewById(R.id.afterAnimationView);
}
private void startAnimation() {
ViewPropertyAnimator viewPropertyAnimator = bookIconImageView.animate();
viewPropertyAnimator.x(50f);
viewPropertyAnimator.y(100f);
viewPropertyAnimator.setDuration(1000);
viewPropertyAnimator.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
afterAnimationView.setVisibility(VISIBLE);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
}
main_activity.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:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
tools:context=".MainActivity">
<ImageView
android:id="@+id/bookIconImageView"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:contentDescription="@null"
android:src="@drawable/white_book_icon" />
<TextView
android:id="@+id/bookITextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/bookIconImageView"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="@string/booki"
android:textColor="@color/colorSplashText"
android:textSize="16sp" />
<ProgressBar
android:id="@+id/loadingProgressBar"
android:layout_width="match_parent"
android:layout_height="12dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="-4dp"
android:foregroundGravity="bottom"
android:indeterminate="true"
android:padding="0dp"
android:theme="@style/ProgressBarStyle" />
<RelativeLayout
android:id="@+id/afterAnimationView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginTop="130dp"
android:layout_marginEnd="20dp"
android:visibility="gone">
<TextView
android:id="@+id/WelcomeTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/welcome_back"
android:textColor="@color/colorBackground"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@+id/readItTogetherTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/WelcomeTextView"
android:layout_marginTop="10dp"
android:text="@string/read_it_together"
android:textColor="@color/colorAccent"
android:textSize="15sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/loginButton"
android:layout_below="@+id/readItTogetherTextView"
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email"
android:textColor="@color/colorTextView"
android:textColorHint="@color/colorAccent"
android:textSize="15sp" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/passwordEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:hint="@string/password"
android:textColor="@color/colorTextView"
android:textColorHint="@color/colorAccent"
android:textSize="15sp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sign_up"
android:textColor="@color/colorTextView"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:text="@string/forget_password"
android:textColor="@color/colorTextView"
android:textSize="14sp"
android:textStyle="bold" />
</FrameLayout>
</LinearLayout>
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_above="@+id/skipTextView"
android:layout_marginBottom="5dp"
android:background="@drawable/button_drawable"
android:text="@string/login"
android:textAllCaps="false"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:id="@+id/skipTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:padding="12dp"
android:text="@string/skip"
android:textColor="@color/colorTextView"
android:textSize="15sp" />
</RelativeLayout>
</RelativeLayout>
build.gradle (приложение)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.testdesign"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
}
API 23
ANDROID STUDIO 3.4.1