私のデータはAndroid経由でAndroid Firebaseに保存されていますが、保存ボタンをクリックするとアプリがクラッシュします。私は何をすべきか?私は多くを検索しましたが、満足のいく回答は得られませんでした。マイ設定 依存関係の適用{Androidファイアベースデータの認証済みユーザによる書き込み
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.firebaseui:firebase-ui-database:0.4.0'
} Firebase
apply.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//progressBar.setVisibility(View.VISIBLE);
Firebase fire=new Firebase(Configuration.FIREBASE_URL);
//Firebase userroot=fire.child(fire.getAuth().getUid());
String name_s=name.getText().toString().trim();
String contact_s=contact.getText().toString().trim();
String blood_s=bloodgroup.getSelectedItem().toString().trim();
String city_s=city.getText().toString().trim();
String country_s=country.getText().toString().trim();
//String password_s=password.getText().toString().trim();
Information information=new Information();
information.setName(name_s);
information.setContact(contact_s);
information.setBloodgroup(blood_s);
information.setCity(city_s);
information.setCountry(country_s);
FirebaseUser user=auth.getCurrentUser();
database.child(user.getUid()).setValue(information);
Toast.makeText(getApplicationContext(),"You are now a DONNOR", Toast.LENGTH_LONG).show();
}
});
に
{"rules": {
".read": true,
".write": "auth != null"
}
}
Javaコードを保存するためのデータ:私はここに私の関連するコード
Firebaseルールを与えていますプラグイン: 'com.google.gms.google-services'
私はチェックしましたが、ユーザーは正常にログインしましたが、firebaseにデータを追加しようとしたときに、アプリケーションが破損しましたが、データが正常に追加されました。状況について本当に混乱しています。 ?
あなたは正確なエラーが何かを推測したいのですか、それともそれほど具体的に指定できますか? – Chisko