简体   繁体   中英

Cannot resolve class error when using library from GitHub

I want to use this library: https://github.com/rongi/rotate-layout

However I get the following errors when I use the code below in my project:

Class referenced in the layout file, com.github.rongi.rotate_layout.layout.RotateLayout, was not found in the project or the libraries
Cannot resolve class com.github.rongi.rotate_layout.layout.RotateLayout 

I used implementation ("rongi.rotate-layout:rotate-layout:3.0.0") and implementation ("com.github.rongi.rotate-layout:rotate-layout:3.0.0")

<com.github.rongi.rotate_layout.layout.RotateLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:angle="90"> <!-- Specify rotate angle here -->

Screenshot

The library is quite old and wasn't migrated to the Maven Central repository , since JCenter was deprecated.

But you can use it from Jitpack repository :

  1. Add it in your root build.gradle at the end of repositories:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency to your app build.gradle:
dependencies {
    implementation 'com.github.rongi:rotate-layout:v3.0.0'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM