类文件错误

xjreopfe  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(195)

我在我的应用程序中添加了添加个人资料图片的功能,为此我尝试使用glide,但是当我运行应用程序时,它指向那行代码,并指出错误,正如我上面提到的,这是我的代码

user= FirebaseAuth.getInstance().getCurrentUser();
        reference= FirebaseDatabase.getInstance().getReference("Users");
        userID=user.getUid();
        reference.child("Customer").child(userID).addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull  DataSnapshot snapshot) {
                Users usersnapshot=snapshot.getValue(Users.class);
                if(usersnapshot!=null){
                    Map<String,Object> map=(Map<String, Object>)snapshot.getValue();
                    String username=usersnapshot.getUsername();
                    String Email=usersnapshot.getMail();//
                    Username.setText(username);
                    name=username;
                    mail=Email;
                    email.setText(Email);
                    button.setEnabled(!username.isEmpty()&&!Email.isEmpty());
                    if(map.get("profileImageUri")!=null){
                        profilepic=map.get("profileImageUri").toString();
                        Glide.with(getApplication()).load(profilepic).into(imageView);\\this is the line where it showed the error
                    }
                }

            }

这些是我的依赖项

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.firebase:firebase-auth:21.0.1'
    implementation 'com.google.firebase:firebase-database:20.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.1'
    implementation 'com.github.bumptech.glide:glide:4.0.0'
    implementation 'com.google.firebase:firebase-storage:20.0.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation platform('com.google.firebase:firebase-bom:28.1.0')
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.firebase:geofire-android:2.1.1'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.android.gms:play-services-auth:19.0.0'
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题