ChaosLeung / PinView

A PIN view library for Android. Use to enter PIN/OTP/password etc.
Apache License 2.0
633 stars 121 forks source link

Illegal char <:> in auto-generated values.xml #74

Open thewolfprod opened 2 years ago

thewolfprod commented 2 years ago

What kind of issue is this?

Info:
Description:

After adding this library, project do not want to compile because I get the error on app:mergeDebugResources:

com.android.aaptcompiler.ResourceCompilationException:
Resource compilation failed
(Failed to compile values resource file C:\Users\hesam\AndroidStudioProjects\RecognizeProject\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. 
Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 40: com.recognize.app-mergeDebugResources-33:/values/values.xml).

After removing the library from the project, the error does not occur.

I don't see any thread in Issues with same problem here so it's a bit strange to that this doesn't want work for me.

Reproduction Steps:
  1. Import library - in build.gradle:
    
    implementation 'io.github.chaosleung:pinview:1.4.4'

other libs that i use: implementation platform('com.google.firebase:firebase-bom:30.0.1') implementation 'com.google.firebase:firebase-auth' implementation 'com.google.firebase:firebase-database' implementation 'com.google.firebase:firebase-storage' implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-crashlytics' implementation 'com.google.firebase:firebase-perf' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.6.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'io.github.yanndroid:oneui:2.4.0' implementation 'com.mikhaellopez:circularimageview:4.3.0' implementation 'com.github.bumptech.glide:glide:4.13.0'

2. Sync Gradle
3. Add OPT View into .xml layout
<com.chaos.view.PinView
    android:id="@+id/pinView"
    style="@style/PinWidget.PinView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:cursorVisible="true"
    android:hint="******"
    android:inputType="text"
    android:padding="8dp"
    android:textColor="@color/primary_color"
    android:textSize="18sp"
    android:textStyle="bold"
    app:cursorColor="@color/sesl_primary_text"
    app:cursorWidth="2dp"
    app:hideLineWhenFilled="false"
    app:itemCount="6"
    app:itemHeight="48dp"
    app:itemRadius="4dp"
    app:itemSpacing="0dp"
    app:itemWidth="48dp"
    app:lineColor="@color/sesl_primary_text"
    app:lineWidth="2dp"
    app:viewType="0" />

4. Debug Build

##### What did I do:
- Clear Project
AliBinkhani commented 1 year ago

I also have this problem and I haven't found a solution yet But what I noticed is that the problem occurs when these two libraries are implemented together:

implementation 'io.github.chaosleung:pinview:1.4.4' implementation 'io.github.yanndroid:oneui:2.4.0'

AliBinkhani commented 1 year ago

I realized that the problem occurs because of the attrs.xml file and the viewType tag. By changing 'viewType' tag to 'pinViewType' in attrs.xml file and 'PinView' class, my problem was solved