Cannot find symbol class DocumentListenOptions
I am trying to recover 6 months old app but I can't build it.
This is a react-native app for Android/iOS. I am using "Android Studio" to build this app.
I can't build the app because it fails to compile:
Compilation failed; see the compiler error output for details.
Compiler errors:
error: cannot find symbol class DocumentListenOptions
error: cannot find symbol class QueryListenOptions
error: cannot find symbol method getDownloadUrl()
Code from error:
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);
}
}
"not a full code, just the place I get an error from"
So it:
cannot resolve symbol "QueryListenOptions"
cannot resolve method "includeDocumentMetadataChanges"
cannot resolve method "addSnapshotListener(options, listener)"
And for this error:
cannot find symbol method 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;
}
cannot resolve method "getDownloadUrl"
So if you have any suggestions for these two problems please share your knowledge.
Thank you! :)
android ios android-studio react-native
add a comment |
I am trying to recover 6 months old app but I can't build it.
This is a react-native app for Android/iOS. I am using "Android Studio" to build this app.
I can't build the app because it fails to compile:
Compilation failed; see the compiler error output for details.
Compiler errors:
error: cannot find symbol class DocumentListenOptions
error: cannot find symbol class QueryListenOptions
error: cannot find symbol method getDownloadUrl()
Code from error:
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);
}
}
"not a full code, just the place I get an error from"
So it:
cannot resolve symbol "QueryListenOptions"
cannot resolve method "includeDocumentMetadataChanges"
cannot resolve method "addSnapshotListener(options, listener)"
And for this error:
cannot find symbol method 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;
}
cannot resolve method "getDownloadUrl"
So if you have any suggestions for these two problems please share your knowledge.
Thank you! :)
android ios android-studio react-native
still not solved, waiting for suggestions :)
– Hi I Am Friend
Nov 13 at 11:51
Release notes? Looks like calls to some of those changed back in May? See this Look for the SDK update, May 2nd, in section: Cloud Firestore version 16.0.0
– Paul T.
Nov 18 at 16:56
add a comment |
I am trying to recover 6 months old app but I can't build it.
This is a react-native app for Android/iOS. I am using "Android Studio" to build this app.
I can't build the app because it fails to compile:
Compilation failed; see the compiler error output for details.
Compiler errors:
error: cannot find symbol class DocumentListenOptions
error: cannot find symbol class QueryListenOptions
error: cannot find symbol method getDownloadUrl()
Code from error:
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);
}
}
"not a full code, just the place I get an error from"
So it:
cannot resolve symbol "QueryListenOptions"
cannot resolve method "includeDocumentMetadataChanges"
cannot resolve method "addSnapshotListener(options, listener)"
And for this error:
cannot find symbol method 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;
}
cannot resolve method "getDownloadUrl"
So if you have any suggestions for these two problems please share your knowledge.
Thank you! :)
android ios android-studio react-native
I am trying to recover 6 months old app but I can't build it.
This is a react-native app for Android/iOS. I am using "Android Studio" to build this app.
I can't build the app because it fails to compile:
Compilation failed; see the compiler error output for details.
Compiler errors:
error: cannot find symbol class DocumentListenOptions
error: cannot find symbol class QueryListenOptions
error: cannot find symbol method getDownloadUrl()
Code from error:
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);
}
}
"not a full code, just the place I get an error from"
So it:
cannot resolve symbol "QueryListenOptions"
cannot resolve method "includeDocumentMetadataChanges"
cannot resolve method "addSnapshotListener(options, listener)"
And for this error:
cannot find symbol method 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;
}
cannot resolve method "getDownloadUrl"
So if you have any suggestions for these two problems please share your knowledge.
Thank you! :)
android ios android-studio react-native
android ios android-studio react-native
edited Nov 12 at 23:52
André Sousa
1,1521818
1,1521818
asked Nov 12 at 23:31
Hi I Am Friend
64
64
still not solved, waiting for suggestions :)
– Hi I Am Friend
Nov 13 at 11:51
Release notes? Looks like calls to some of those changed back in May? See this Look for the SDK update, May 2nd, in section: Cloud Firestore version 16.0.0
– Paul T.
Nov 18 at 16:56
add a comment |
still not solved, waiting for suggestions :)
– Hi I Am Friend
Nov 13 at 11:51
Release notes? Looks like calls to some of those changed back in May? See this Look for the SDK update, May 2nd, in section: Cloud Firestore version 16.0.0
– Paul T.
Nov 18 at 16:56
still not solved, waiting for suggestions :)
– Hi I Am Friend
Nov 13 at 11:51
still not solved, waiting for suggestions :)
– Hi I Am Friend
Nov 13 at 11:51
Release notes? Looks like calls to some of those changed back in May? See this Look for the SDK update, May 2nd, in section: Cloud Firestore version 16.0.0
– Paul T.
Nov 18 at 16:56
Release notes? Looks like calls to some of those changed back in May? See this Look for the SDK update, May 2nd, in section: Cloud Firestore version 16.0.0
– Paul T.
Nov 18 at 16:56
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271621%2fcannot-find-symbol-class-documentlistenoptions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271621%2fcannot-find-symbol-class-documentlistenoptions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
still not solved, waiting for suggestions :)
– Hi I Am Friend
Nov 13 at 11:51
Release notes? Looks like calls to some of those changed back in May? See this Look for the SDK update, May 2nd, in section: Cloud Firestore version 16.0.0
– Paul T.
Nov 18 at 16:56