inMutable不能得到解决或不是字段 [英] inMutable cannot be resolved or is not a field

查看:581
本文介绍了inMutable不能得到解决或不是字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一条错误消息,指出inMutable不能得到解决或不是场,我相信这是因为这是在11 API和介绍我是previously使用API​​ 8.

我升级我的清单以使用minSDK 19,和更新我的构建路径,包括SDK 19的外部JAR,清洗的项目,我不知道还有什么我可以为了解决这个在这一点上做的问题。

来源:

 私人位图getThumb(String s)将
{
    // BMP位图= Bitmap.createBitmap(150,150,Bitmap.Config.RGB_565);
    BitmapFactory.Options选择=新BitmapFactory.Options();
     opt.inMutable = TRUE;
     BMP位图= BitmapFactory.de codeResource(getResources(),R.drawable.sqwhite,OPT);

清单:

 <?XML版本=1.0编码=UTF-8&GT?;
<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
      包=com.animoto.android
      安卓版code =1
      机器人:=的versionName1.0>
    <采用-SDK安卓的minSdkVersion =19/>    <应用机器人:图标=@绘制/图标机器人:标签=@字符串/ APP_NAME>
        <活动机器人:名字=。DraggableGridViewSampleActivity
                  机器人:标签=@字符串/ APP_NAME>
            &所述;意图滤光器>
                <作用机器人:名字=android.intent.action.MAIN/>
                <类机器人:名字=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
        < /活性GT;    < /用途>
< /清单>


解决方案

请确保您的项目的生成SDK来API级别为11或更高。

在Eclipse / ADT您可以在属性做到这一点 - > Android的 - >项目构建目标或编辑 project.properties 。后改变它,清洁和重建。

从评论:


  

我右键点击该项目,然后单击属性> Java构建路径>库>我点击添加外部JAR和选择并添加C:\\ SDK \\平台工具project.properties \\ Android的19我有8


构建SDK花费precedence对项目库。 BitmapFactory.Options 解析为你的Andr​​oid-8 SDK,并在那里有没有 inMutable 字段。

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>

解决方案

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.

这篇关于inMutable不能得到解决或不是字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆