@EgorItChainik

Не работает SwipeCard как исправить?

Решил сделать свайп с использованием библиотеки koloda Android. Компилятор выдает ошибки в xml item koloda вот ошибки: Android resource linking failed
org.gradle.workers.internal.DefaultWorkerExecutor WorkExecutionException : A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable java.lang.RuntimeException : Duplicate class android.support.v4.app.INotificationSideChannel found in modules core - 1.8.0 - runtime ( androidx.core.core : 1.8.0 ) and support - compat - 26.10 - runtime ( com.android.supportsupport - compat261.0 ) org.gradle workers.internal.DefaultWorkerExecutor $ WorkExecutionException : A failure occurred while executing com.android.build.gradle.internal.res.LinkApplication AndroidResources Task $ TaskAction com.android.builder.internal.aaptv2 Aapt2Exception : Android resource linking failed C \ Users \ Acer AndroidStudioProjectsMyApplication3 \ app \ src \ main \ res \ layout / item_kolodaxml : 33 : AAPT : error : attribute layout constraintTop to Topof ( aka testmaniya.app:layout constraintTop to Topof ) not found CUsers \ Acer AndroidStudioProjectsMyApplication3 \ app \ src \ main \ res \ layout \ item_koloda.xml : 33 : AAPT : error attribute layout_constraintStart_toStartof ( aka testzmaniya.appdayout constraintStart toStarto ) not found CUsers \ Acer AndroidStudioProjects MyApplication3 \ app \ src \ main \ res \ Jayout \ item_koloda.xml : 33 : AAPT : error : attribute layout constraintEnd_toEndof ( aka testzmaniya.app:layout constraintEnd , toEndof ) not found C \ Users \ Acer AndroidStudioProjects MyApplication3 \ app \ src \ main \ res \ layout \ item_koloda.xml : 52 : AAPT : error : attribute layout constraintStart_toStartof ( aka testzmaniya.app:layout constraintStart toStarto ) not found C \ Users \ Acer AndroidStudioProjectsMyApplication3 \ app \ src \ main \ res \ layout item_kolodaxml : 52 : AAPT : error attribute layout constraintEnd_toEndof ( aka testmaniya.app:layout constraintEnd toEndof ) not found . C \ Users \ Acer AndroidStudioProjects MyApplication3 \ app \ src \ main \ res \ layout item kolodaxml : 62 : AAPT : error . attribute layout constraintStart toStartof ( aka testmaniya.applayout constraintStart toStartof ) not found CUsers \ Acer AndroidStudioProjects MyApplication3 \ src \ main \ res \ layoutVrem koloda.xml : 62 : AAPT : error : attribute layout constraintEnd_toEndof ( aka testmaniya.app:layout.comtraintEnd Duplicate class found
Вот сама item koloda xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_gravity="center"
    android:gravity="center"
    android:layout_height="match_parent">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="500dp"
        android:layout_margin="15dp"
        app:cardCornerRadius="15dp"
        app:cardElevation="5dp">

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

            <com.google.android.material.imageview.ShapeableImageView
                android:id="@+id/image"
                android:layout_width="match_parent"
                android:layout_height="400dp"
                android:backgroundTint="@color/white"
                android:scaleType="fitXY"
                app:layout_constraintEnd_toEndof="parent"
                app:layout_constraintStart_toStartof="parent"
                app:layout_constraintTop_toTopof="parent"
                app:srcCompat="@drawable/aaaaa" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:orientation="horizontal"
                android:layout_gravity="bottom"
                android:weightSum="3">

            <ImageView
                android:layout_width="90dp"
                android:layout_height="90dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:src="@drawable/sas"
                app:layout_constraintEnd_toEndof="parent"
                app:layout_constraintStart_toStartof="parent"
                />
                <ImageView
                    android:layout_width="90dp"
                    android:layout_height="90dp"
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:src="@drawable/aan"
                    app:layout_constraintEnd_toEndof="parent"
                    app:layout_constraintStart_toStartof="parent"
                     />


            </LinearLayout>
        </LinearLayout>



    </androidx.cardview.widget.CardView>



</LinearLayout>

Так же ошибка в java class который создал для адаптера вот её код
public class SwipeAdapter extends BaseAdapter {

    private Context context;
    private List<Integer> list;


    public SwipeAdapter(Context context,List<Integer>list) {
        this.context=context;
        this list=list;

    }

    @Override
    public int getCount() {
        return 20;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
     View view;
     if(convertView==null){
         view= LayoutInflater.from(parent.getContext()).Inflate(R.layout.item_koloda,parent,false);

     }else {
         view=convertView;
     }
     return view;
    }
}

Вот ошибка адаптера:Not a statement : 19 Variable ' view ' is already defined in the scope : 40 Cannot resolve symbol ' convertView ' : 41 Cannot resolve symbol ' parent ' : 42 Cannot resolve symbol ' parent ' : 42 Cannot resolve symbol ' convertView " : 45.
Как это исправить? Заранее благодарю.
  • Вопрос задан
  • 34 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы