Я пытаюсь восстановить 6-месячное приложение, но не могу его создать.
Это родное приложение для Android / iOS. Я использую " Android Studio " для создания этого приложения.
Я не могу собрать приложение, потому что оно не компилируется:
Компиляция не удалась; подробности смотрите в сообщении об ошибке компилятора.
Ошибки компиляции:
ошибка: не удается найти класс символов DocumentListenOptions
ошибка: не удается найти класс символов QueryListenOptions
ошибка: не удается найти метод символа getDownloadUrl ()
Код с ошибкой:
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.firestore.DocumentListenOptions;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FieldPath;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;
import com.google.firebase.firestore.ListenerRegistration;
import com.google.firebase.firestore.Query;
import com.google.firebase.firestore.QueryListenOptions;
import com.google.firebase.firestore.QuerySnapshot;
public void onSnapshot(final String listenerId, final ReadableMap queryListenOptions) {
if (!collectionSnapshotListeners.containsKey(listenerId)) {
final EventListener<QuerySnapshot> listener = new EventListener<QuerySnapshot>() {
@Override
public void onEvent(QuerySnapshot querySnapshot, FirebaseFirestoreException exception) {
if (exception == null) {
handleQuerySnapshotEvent(listenerId, querySnapshot);
} else {
ListenerRegistration listenerRegistration = collectionSnapshotListeners.remove(listenerId);
if (listenerRegistration != null) {
listenerRegistration.remove();
}
handleQuerySnapshotError(listenerId, exception);
}
}
};
QueryListenOptions options = new QueryListenOptions();
if (queryListenOptions != null) {
if (queryListenOptions.hasKey("includeDocumentMetadataChanges")
&& queryListenOptions.getBoolean("includeDocumentMetadataChanges")) {
options.includeDocumentMetadataChanges();
}
if (queryListenOptions.hasKey("includeQueryMetadataChanges")
&& queryListenOptions.getBoolean("includeQueryMetadataChanges")) {
options.includeQueryMetadataChanges();
}
}
ListenerRegistration listenerRegistration = this.query.addSnapshotListener(options, listener);
collectionSnapshotListeners.put(listenerId, listenerRegistration);
}
}
"не полный код, просто место, где я получаю сообщение об ошибке"
Итак, это:
невозможно разрешить символ "QueryListenOptions"
не удается разрешить метод "includeDocumentMetadataChanges"
не удается разрешить метод "addSnapshotListener (options, listener)"
И за эту ошибку:
не удается найти метод символа getDownloadUrl ()
private WritableMap getUploadTaskAsMap(UploadTask.TaskSnapshot taskSnapshot) {
WritableMap resp = Arguments.createMap();
if (taskSnapshot != null) {
resp.putDouble("bytesTransferred", taskSnapshot.getBytesTransferred());
resp.putString("downloadURL", taskSnapshot.getDownloadUrl() != null ? taskSnapshot.getDownloadUrl().toString() : null);
StorageMetadata d = taskSnapshot.getMetadata();
if (d != null) {
WritableMap metadata = getMetadataAsMap(d);
resp.putMap("metadata", metadata);
}
resp.putString("ref", taskSnapshot.getStorage().getPath());
resp.putString("state", this.getTaskStatus(taskSnapshot.getTask()));
resp.putDouble("totalBytes", taskSnapshot.getTotalByteCount());
}
return resp;
}
не удается разрешить метод "getDownloadUrl"
Так что, если у вас есть предложения по этим двум проблемам, пожалуйста, поделитесь своими знаниями.
Спасибо! :)