程序类型已存在:com.bumptech.glide.BitmapOptions

时间:2018-05-19 08:09:08

标签: android

我的目的是用glide加载图片。当编译android项目时,会出现这样的错误: 程序类型已存在:com.bumptech.glide.BitmapOptions Message{kind=ERROR, text=Program type already present: com.bumptech.glide.BitmapOptions, sources=[Unknown source file], toolname=Optional.of(D8)} 这个问题困扰了我很长一段时间,谢谢你的回答

的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "com.example.usercenter"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'jp.wasabeef:glide-transformations:2.0.1'
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
}

Mainactivity.java:

    public class MainActivity extends AppCompatActivity {
        private ImageView blurImageView;
        private ImageView avatarImageView;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            this.requestWindowFeature(Window.FEATURE_NO_TITLE);//
            setContentView(R.layout.activity_main);//
            blurImageView = (ImageView) findViewById(R.id.iv_blur);//
            avatarImageView = (ImageView) findViewById(R.id.iv_avatar);//

            Glide.with(this).load(R.drawable.head)
                    .bitmapTransform(new BlurTransformation(this, 25), new CenterCrop(this))
                    .into(blurImageView);

            Glide.with(this).load(R.drawable.head)
                    .bitmapTransform(new CropCircleTransformation(this))
                    .into(avatarImageView);
        }
    }
Who can help me,please?

1 个答案:

答案 0 :(得分:0)

删除 <foo bar ber>.map: { $^a.comb.map: { $^b.say}};

使用最新版本

<foo bar ber>.map: *.say; # OUTPUT: «foo␤bar␤ber␤»

compile 'com.github.bumptech.glide:glide:3.7.0' 您的项目