Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8133009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:29:02+00:00 2026-06-06T09:29:02+00:00

The Android compiler complains that Google Guava v12’s ImmutableSortedSet doesn’t have the methods, first()

  • 0

The Android compiler complains that Google Guava v12’s ImmutableSortedSet doesn’t have the methods, first(), last(), etc., and that ImmutableSortedSet doesn’t implement SortedSet. I am currently using Android API 8. Here’s some sample code:

/* 
 * I only have one set, 'mSet', but for the sake of this example
 * I added an ImmutableSortedSet instance.
 */
private final SortedSet<Item> mSet;
private final ImmutableSortedSet<Item> mImmutableSet;

private MyObject(Collection <? extends Item> items) {
  // Fails -- cannot convert from ImmutableSortedSet<Item> to SortedSet<Item>
  mSet = ImmutableSortedSet.copyOf(items);
  mImmutableSet = ImmutableSortedSet.copyOf(items);
}

private Item getFirstItem() {
  // Fails -- no such method 'first()' in ImmutableSortedSet
  return mImmutableSet.first();
}

UPDATE
I did a bit of digging, and it turns out NavigableSet, the interface that ImmutableSortedSet implements, only became available in API level 9 and up. I am unfortunately constrained to using API level 8. My question still stands though. Is there a way to fix this without having to play with Google’s code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:29:05+00:00Added an answer on June 6, 2026 at 9:29 am

    Guava 12.0 does not support your version of Android, so please stick to version 11.0.2 for now until we have a backport.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that the Android resource compiler does not take into account linked folders
It's always give that error: [-] Starting full Post Compiler. [-] /home/marcos/dev/programs/android-sdk-linux_x86/platform-tools/aapt package -v
I am building a simple Android project in eclipse that uses the google-api-java-client .
I have created an Android Library. That has all the main code. Also I
Is it possible to have a Android VNC server compiled lib inside my android
I have successfully compiled the FFMPEG library to android using NDK. I want to
I have been using Eclipse to compile and run my development Android app. Now
Scenario: I have run and compiled an existing c++ code of cocos2d-x on android
I'm beginning with android NDK. I have to compile a native library for the
There is a class, that compiles with the android platform and the jdk .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.