Buenos días, soy nuevo aquí al menos en la parte en español pero preferí mudarme para acá, esta es mi primera pregunta (soy nuevo programando llevo como poco más de un par de semanas). Estoy siguiendo una serie de tutoriales para hacer una aplicación en Android tipo Blog usando Firebase. El error sucede cuando en la pantalla de enviar la imagen a mi storage en Firebase luego de seleccionarla de mi galería y hacer clic en botón que en teoría debería enviarla a almacenar además de haber llenado los campos para asignarle un título y descripción la pantalla del emulador solo me muestra el toast "Posting to Blog..." que le asigné que mostrara, pero este se queda allí indefinidamente, se mantiene eternamente cargando y nunca se cierra. Además de que la imagen no se almacena. He cambiado las regla de mi Firebase tanto en Storage como en Database a públicas siguiendo las reglas de https://firebase.google.com/docs/ he agregado premisos a Internet en el Manifest y he cambiado en gradle build la versión de los servicios de 10.0.0 a 9.6.0 pero igualmente.
Este es el tutorial https://www.youtube.com/watch?v=x0ScnHJi8WY&t son solo 8 minutos.
La consolar al correr la aplicación en el emulador me muestra los siguientes errores
W/DynamiteModule: Failed to retrieve remote module version.
W/DynamiteModule: Failed to load module via fast routecom.google.android.gms.dynamite.DynamiteModule$zza: Failed to connect to dynamite module ContentResolver.
W/GooglePlayServicesUtil: Google Play services out of date. Requires 10084000 but found 9877470
W/DynamiteModule: Local module descriptor class for com.google.android.gms.firebasestorage not found.
I/DynamiteModule: Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:0
E/NetworkRqFactoryProxy: NetworkRequestFactoryProxy failed with a RemoteException:
com.google.android.gms.dynamite.DynamiteModule$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.dynamite.DynamiteModule.zza(Unknown Source)
at com.google.android.gms.dynamite.DynamiteModule.zza(Unknown Source)
at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
at com.google.firebase.storage.UploadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
E/UploadTask: Unable to create a network request from metadata
android.os.RemoteException
at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
at com.google.firebase.storage.UploadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
E/StorageException: null
android.os.RemoteException
at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
at com.google.firebase.storage.UploadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
E/StorageException: null
android.os.RemoteException
at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
at com.google.firebase.storage.UploadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
E/EGL_emulation: tid 2710: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8b8cd120, error=EGL_BAD_MATCH
Este es mi build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.social.socialpart.socialpart"
minSdkVersion 14
targetSdkVersion 25
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.google.firebase:firebase-database:9.6.0'
compile 'com.google.firebase:firebase-storage:9.6.0'
compile 'com.google.firebase:firebase-auth:9.6.0'
compile 'com.firebaseui:firebase-ui-database:1.1.1'
compile 'com.firebaseui:firebase-ui-storage:1.1.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Y por ultimo mi clase en java, espero alguien pueda ayudarme, gracias,
public class PostActivity extends AppCompatActivity {
private ImageButton mSlectImage;
private EditText mPostTittle;
private EditText mPostDesc;
private Button SubmitButton;
private Uri mImageUri= null;
private static final int GALLERY_REQUEST=1;
private StorageReference mStorage;
private ProgressDialog mProgress;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post);
mStorage= FirebaseStorage.getInstance().getReference();
mPostTittle=(EditText) findViewById(R.id.CreatePost_title);
mPostDesc=(EditText) findViewById(R.id.CreatePost_description);
SubmitButton=(Button) findViewById(R.id.Publicar_button);
mProgress=new ProgressDialog(this);
mSlectImage=(ImageButton) findViewById(R.id.imageButton);
mSlectImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent galleryIntent=new Intent(Intent.ACTION_GET_CONTENT);
galleryIntent.setType("image/*");
startActivityForResult(galleryIntent,GALLERY_REQUEST);
}
});
SubmitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startPosting();
}
});
}
private void startPosting() {
mProgress.setMessage("Posting to Blog...");
mProgress.show();
String title_val= mPostTittle.getText().toString().trim();
String desc_val= mPostDesc.getText().toString().trim();
if (!TextUtils.isEmpty(title_val)&& !TextUtils.isEmpty(desc_val)&& mImageUri!=null){
StorageReference filepath=mStorage.child("Blog_images").child(mImageUri.getLastPathSegment());
filepath.putFile(mImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri downloadUri = taskSnapshot.getDownloadUrl();
mProgress.dismiss();
}
});
}
}
@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data){
super.onActivityResult(requestCode,resultCode,data);
if (requestCode==GALLERY_REQUEST && resultCode==RESULT_OK){
mImageUri=data.getData();
mSlectImage.setImageURI(mImageUri);
}
}
}