Android: Emulator can't pull from database / Extremely slow? - java

So I had my Android Emulator working perfectly fine yesterday and the day before, a Pixel 3a XL 28. Worked like a charm.
I restarted my computer and this morning, and now NONE of the emulators are working at all.
Early in the day, it was sort of working but it was extremely slow, and now it won't work at all.
I just get a blank white screen. My code is running, and I am just getting an error in my code that my database document doesn't exist, even though it does, and it takes a good minute or two to get to the database call in the first place. I am on a Mac OS.
I have an android phone that I just ran the code on, and it works like a charm.
FirebaseFirestore.getInstance()
.collection("Users")
.document("hjkyilk")
.get()
.addOnSuccessListener { result ->
...
}
.addOnFailureListener { exception ->
// Always hitting this, although this database DEFINITELY exists
println("User doesn't exist")
}
with this error:
2020-02-05 14:58:47.751 5504-5504/com.example.casualdatingapp E/ResourcesCompat: Failed to find font-family tag
2020-02-05 14:58:47.779 5504-5504/com.example.casualdatingapp E/ResourcesCompat: Failed to find font-family tag
2020-02-05 14:58:47.814 5504-5504/com.example.casualdatingapp E/ResourcesCompat: Failed to find font-family tag
2020-02-05 14:58:48.069 5504-5575/com.example.casualdatingapp E/FirebaseInstanceId: Topic sync or token retrieval failed on hard failure exceptions: AUTHENTICATION_FAILED. Won't retry the operation.
2020-02-05 14:58:48.124 5504-5605/com.example.casualdatingapp E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1
2020-02-05 14:58:49.803 5504-5504/com.example.casualdatingapp E/RecyclerView: No adapter attached; skipping layout
2020-02-05 14:58:49.842 5504-5575/com.example.casualdatingapp E/FirebaseInstanceId: Topic sync or token retrieval failed on hard failure exceptions: AUTHENTICATION_FAILED. Won't retry the operation.
What in the world is going on here? I have tried cold booting, installing new OS/Emulators, wiping the data on the emulators, nothing is working.
EDIT: It's worth noting when it worked this morning, it wasn't able to pull or write to my database at all, but the data it was trying to write was stored somewhere else. My database was never updated, but when I opened the emulator, the new content was still there. I don't even know how that's possible.

Okay, so I had a completely separate virtual UNIX server running on my computer and apparently it was constantly killing the processes of the emulator...
Don't run more than 1 virtual server at a time.

Related

Trying out Expo for React Native, just did an "init", getting socketException error?

Last week I started learning about React Native and using Expo. I created some small apps using "expo init (name)" etc, followed some tutorials, tried some stuff you know the drill.
Today I wanted to start working on a small app idea I have and wanted to do it using Expo CLI instead of React Native CLI first, since building, testing etc is supposed to be easier using Expo.
I just made a new project using "expo init (name)", selecting blank template (so nothing fancy) and running "npm start", then scanning the code with my smartphone app and the app crashes instantly. The error is as follows:
"Uncaught Error: java.net.SocketException: Connection reset"
What does this mean? How can I fix it? I really want to start today using Expo...
This happens when you mobile and system using different internet connection or port.
so try following
Make sure you have stable internet connection and your device and system connected with same internet connection
remove node_modules folder
run npm install
npm start --reset-cache
scan bar code to run it on your device

com.google.firebase.FirebaseException: An internal error has occurred. [ 7: ]

I used to create accounts and connect to my application with firebase but then soon when I disconnected I couldn't create accounts. After 1h of that, I managed to create an account and when I disconnected to see if the problem was resolved, I realize that it's still there.
By doing task.getException() in case of account creation failure, I get this error:
"com.google.firebase.FirebaseException: An internal error has occurred. [7:]"
Do you have an idea of ​​the cause of the problem?
I have same problem because my internet was not active.
Make sure you have active internet connection.
If you are sure you have an active Internet connection and you are testing from an Emulator, restart your emulator and it should work. Sometimes, the emulator disconnects from the Internet and these sort of problems occur.
I had a similar issue and got the same exception and code: 7. I was calling firebaseUser.getIdToken() in a Rx stream. So while testing the apps functionality while being offline, I found that the JWT token that is returned in firebaseUser.getIdToken() had expired and was throwing said error. It has a lifetime of 1h.
So I split out my implementation to separate functions, only calling firebaseUser.getIdToken() before a authorised call, which must be done while online anyway to be sure and secure.
Without seeing any code, it seems you are signed in/keep a reference to a expired firebase token. Make sure you signed out properly from firebaseAuth before calling your "account creation" piece.
Here is how I solved the same issue: Opened a browser on my emulator, typed something and searched. After that, I came back to my app and retried to connect to firebase and everything started to work well.
The reason of the issue was probably the emulator not being able to connect to internet until I searched something in Google.
I have the same issue too.
My application crashed on offline mode/airplane mode.
getIdToken returns the current token if it has not expired. Otherwise, this will refresh the token and return a new one, more info here
In my case, I called the getIdToken like this getIdToken(true) which means I force refresh regardless of token expiration.
In my case call, getIdToken(false) like this solves the issue.
I have tested the offline mode/airplane mode and it works great.

Android WifiP2PService java.IllegalArgumentException : Null device causing phone to randomly reboot

I am using Android WifiP2P service to make a group connection between 10 phones with one being the Host and others being Guests. I coded everything and it seems to be working fine when I test on API<=22, but on API 23 and higher I randomly get
E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiP2pService
Java.lang.IllegalArgumentException: Null device
The error occurs with no apparent trigger, and it happens randomly. Sometimes phones are able to communicate with no issues for almost 30 minutes, but sometimes it happens a couple of times in just a few minutes.
I am not sure what might be causing this. I would be very grateful if someone finds time and knowledge to help me with this issue. Thanks in advance!
This is a screenshot of the error.

Android AWS Cognito: unable to resolve host

I am having difficulty getting Cognito registration and login to work for my app in Android Studio using this sample. When I attempt to log in via the simulator, the app works for a few seconds, then displays an error message: "Unable to execute HTTP request: Unable to resolve host 'cognito-idp.us-east-1.amazonaws.com': No address associated with hostname". This same error is the only error that appears in the console. I have seen similar questions and tried solutions such as checking to ensure my app has the permissions android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE, but the error persists. It also doesn't seem to be a network issue. I have updated to the latest version of the Android SDK as well as the AWS SDK, and the problem persists.
I currently I have a Cognito user pool set up which works properly for login on the iOS version of my app. Following the instructions in the readme for the sample code, I added an app to my existing user pool, and then copied and pasted the newly generated app client ID and app client secret into AppHelper.java for clientId and clientSecret respectively. I also set userPoolId to the ID listed for my user pool under "pool details" in the Cognito conosle, and cognitoRegion to US East, since this is the region of my user pool. I noticed that there was no need for me to set the pool name, as there was in the iOS version, so I'm wondering if that's something I need to do.
Sorry if this counts as a duplicate, but I wanted to post a question with the exact error message I encountered and the steps I took, and I'm wondering if someone has managed to get this specific sample working and what I should do.
The problem has been resolved, but unfortunately I'm not quite sure what fixed it since I didn't change anything in the code. All I did was install an update, so anyone with a similar problem should probably ensure that all SDKs used in the sample are properly updated, along with the simulator. It's also worth noting that I was using a different network than in my previous tests, so it's possible that it was a network issue after all.
I had the same issue.
The issue occurred when I used a VPN with emulator to test my program. The reason was that the internet connection in the emulator was too slow when connecting through a VPN.
This could also happen if your internet connection is not strong enough.
The solution is, use a real android device to test your code, if your internet connection is not good enough.
More info: https://github.com/aws-amplify/aws-sdk-android/issues/567

Android Facebook API error: something went wrong please try again

i'm sorry to repost this question, but the other one was put on hold for no reason and i have an app out there that doesn't work because of this problem, and i need a fix as soon as possible.
THIS IS THE ONLY INFO ECLIPSE AND THE APP ITSELF GIVES TO ME:
i've developed an app for android that uses fb to share a link, when i share a post with MY fb account everything goes fine, except that no one sees that post! but when i do with my gf's it doesn't even post it and gives me back a toast saying that error and logcat is this:
04-18 15:57:57.650: E/Activity(16658): Error: com.facebook.FacebookException: Error publishing message
there, i do this:
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(Favorites.this)
.setDescription("xxxxxxxxxxxxxx")
.setApplicationName("xxx")
.setName("xxx")
.setPicture(imagesURL+filenames.get(location))
.setLink("http://xxxxxxxxxx"+filenames.get(location))
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
The only possible reason seems to me is that, your application is still in the development mode. If so, besides you and other administrators/testers/developers; no one can see the post and also can't publish a post via your app.
To change the mode of your app to live in the app settings-

Categories