1

I'm getting an error message stating "inMutable cannot be resolved or is not a field" and I believe this is because this was introduced in API 11 and I was previously using API 8.

I've upgraded my manifest to use minSDK 19, and updated my build path to include the external JAR for SDK 19, cleaned the project and I'm not sure what else I can do at this point in order to resolve this issue.

Source:

private Bitmap getThumb(String s)
{
    //Bitmap bmp = Bitmap.createBitmap(150, 150, Bitmap.Config.RGB_565);
    BitmapFactory.Options opt = new BitmapFactory.Options();
     opt.inMutable = true;
     Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.sqwhite, opt);

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.animoto.android"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="19" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".DraggableGridViewSampleActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>
6
  • can you post your code? Commented Jan 7, 2014 at 18:09
  • Can you provide the code that generates this error? Commented Jan 7, 2014 at 18:09
  • Posted. (Please let me know if any additional information is necessary) Commented Jan 7, 2014 at 19:37
  • Please post your Manifest file as well. Commented Jan 7, 2014 at 19:40
  • 1
    What does "updated my build path to include the external JAR for SDK 19" mean - is the build sdk android-19 in project.properties? (In case you're using Eclipse/ADT) Commented Jan 7, 2014 at 19:46

2 Answers 2

2

Make sure your project's build SDK to API level is 11 or higher.

In Eclipse/ADT you can do this in Properties -> Android -> Project Build Target or editing project.properties. After changing it, clean and rebuild.

From comments:

I right clicked on the project and click properties > java build path > libraries > I clicked add external JAR and selected and added c:\sdk\platform-tools\android-19 in project.properties I have 8

The build SDK takes precedence over project libs. BitmapFactory.Options resolves to your android-8 SDK and in there there's no inMutable field.

Sign up to request clarification or add additional context in comments.

4 Comments

I tried... I'm getting an error stating: DraggableGridViewSample] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/animoto/android/views/DraggableGridView$1; any ideas?
Looks like you have duplicate libraries in build paths.
I removed the libraries from External Jars and from the libs folder and rebuilt but the error wont go away
0

Make sure that the following two changes are done:

  1. The minimum API should be at least 11 in the Android manifest file
  2. The correct API should be linked to your project, as @laalto demonstrated hour

You should have something like this in your Manifest file:

<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19"/>

You should always target the latest API, and have the latest API linked to the project, and set the minimum as I have included to whatever your true minimum is. If you do this, you can selectively use new features in the API if available.

2 Comments

I'm getting an error stating: DraggableGridViewSample] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/animoto/android/views/DraggableGridView$1; any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.