AppCompat-v7 and RecyclerView

8 posts, 0 answers
  1. Pat
    Pat avatar
    6 posts
    Member since:
    Mar 2015

    Posted 12 Mar 2015 Link to this post

    I'm attempting to set up Android Studio (today's version) on Linux for the trial version.

    The instructions say this is compatible with API 9, and that I must reference AppCompat-v7 and the RecyclerView for my target API (which is 10) in build.gradle.

    AppCompat-v7 (according to trusted resources like StackExchange) is only available for API-11+ though.

    Yes, I could target a more recent API and the universe would not implode as a direct result, but A) I don't want to, and B) something is wrong. Either UI for Android supports API-9 and AppCompat isn't really necessary, or it only supports API-11 and up.

    Which is it? Also: Is RecyclerView only used for lists, or is it used for all scrollable areas? I have my own lists.

    Thanks in advance
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 12 Mar 2015 Link to this post

    Hello Pat,

    Thank you for your question.

    As this article states, most of our controls require the v7 appcompat library and the list view control additionally requires the v7 recyclerview library, which answers one of your questions: RecyclerView is used only for RadListView. These two support libraries should be supported since API level 7 (as their names implies) and as it is stated in trusted resources like the official android documentation.

    I encourage you to try for yourself the steps from the instructions and add the required dependencies for the controls that you plan to use and let us know if you encounter issues of any kind.

    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Pat
    Pat avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Mar 2015 in reply to Todor Link to this post

    Right beneath the gradle code for AppCompat and RecyclerView is a warning:

    "It is very important to make sure that the target SDK version of your project is aligned with the v7 AppCompat and v7 RecyclerView versions. For example, if you are targeting the v21 SDK you also need to target the 21.+ v7 AppCompat and v7 RecyclerView libraries."

    That is the part that is, I think, wrong.

    Using 21 or 22 seems to cause no complaint on a barebones app but it violates that warning. We'll see...

    On a brand new Android Studio (1.1.0) install, importing the Android Studio example won't build. Lots of Gradle errors, beginning with "Error:Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'.
    Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
    <a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
    <a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes."

    Neither resync nor restart get past this. 

    I'm going to blame Google for general reasons, pretend that it worked great, and write my own example.
  5. Pat
    Pat avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Mar 2015 Link to this post

    It looks to me like Android Studio is no longer an option. A new 1.1.0 project doesn't have a structure that resembles Telerik's example at all. I created a "libs" folder in every physical path of the project and Gradle can't find it to compile the dependency .aar files.

    Android Studio is just a stripped-down, lobotomized, and broken IntelliJ anyway.

    Pro Tip: people who will spend $200 for a calendar and charts toolkit aren't likely to use a free IDE. For Android, they're going to use IntelliJ IDEA Ultimate. That should be Telerik's first documented IDE setup.

    I'm going to go try setting up for Eclipse now. I'm not enthusiastic about it.
  6. Pat
    Pat avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Mar 2015 Link to this post

    The Eclipse example does not import using Eclipse Luna (what you get when you download Eclipse today) and Telerik's Eclipse instructions steps cannot be followed.

    If I skip the (impossible) library import steps and go straight to importing the Eclipse example, Eclipse throws an error:

    "Invalid project description." The detail on that error indicates that "the project Eclipse overlaps an existing project Eclipse".

    Eclipse Luna imports my current Android project without error, and with some simple proguard configuration changes, it builds and runs.

    Maybe the current AS and Eclipse work with UI for Android under Windows. I'll never know.
  7. Pat
    Pat avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Mar 2015 in reply to Pat Link to this post

    IntelliJ IDEA 14 yields the same Gradle error as Android Studio if I try to import the example. IntelliJ is using the system's gradle (1.5), which *should* work.

    Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'.

    (reported to IntelliJ support)
  8. Pat
    Pat avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Mar 2015 Link to this post

    I removed the default Ubuntu gradle, built/installed Gradle 2.2.1, cleared the cache, and I can now build the AndroidStudio example in IntelliJ IDEA 14 or from the command line.

    After all that, I discovered that Android Studio 1.1.0 for Linux has a defective Gradle 2.2.1 build: gradle-2.2.1/bin/gradle has perms 0644, should be 0755. Android Studio will use the system default gradle apparently.

    Not SOLVED. The documentation errors are still there.
  9. Todor
    Admin
    Todor avatar
    778 posts

    Posted 16 Mar 2015 Link to this post

    Hello Pat,

    Thanks for your extensive feedback.

    Regarding the requirement about the version aligning, I agree that it is a little misleading and we are going to change it. What you need is to have a compile sdk version of at least 21, since we are using features that have been introduced with that version in our controls. Additionally, you will notice that Android Studio will warn you about the necessary "alignments" like "Target sdk should not be higher than compile sdk" and "The support library should not use a lower version than the target sdk version".

    Android Studio did not actually change dramatically the way the projects are structured, it simply changed the way they are visualized by default. Now they are shown in a Android view which you can change to Project view so that your project is visualized as in our documentation (as shown in the attached image).

    We are going to extend the getting started with eclipse documentation article so that it is easier to follow with Eclipse Luna as well.

    The documentation will be updated by the end of the week. Don't hesitate to write us back if you notice anything else that is incorrect, misleading or if you simply think that is not clear enough.


    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner