AdbCommandRejectedException in Android Studio - java

I'm trying to run a project in Android Studio and I keep getting this weird error.
PropertyFetcher: AdbCommandRejectedException getting properties for device 3004a4ebc1303100: device offline
PropertyFetcher: AdbCommandRejectedException getting properties for device 3004a4ebc1303100: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device.

have you checked in DDMS perspective that your device is showing online?
Try Resetting adb from the DDMS

Related

Android App doesn't have internet connection - No Permissions required

Well, I have built an app to store values on a remote database. It works!! I didn't use an emulator for testing instead I used my own phone. Now the problem is that on my phone, it works perfectly...no issues but when I installed it on another phone, the app doesn't connect to the internet.
I have included internet permission in android manifest.xml.
I have tried these but didn't work:
Building apk and installing in the new phone.
Compiling directly to the new phone.
Sending the apk from old phone to new phone via shareit.
Creating a signed apk and installing.
Checked via wifi and mobile data (NOTE: BOTH WIFI AND MOBILE DATA WORKS IN OLD PHONE).
Checked android compatibility: supports up to android 10.
*I added error messages for try...catch blocks in form of toasts for the user to know what's the issue. and the catch exception for no internet returns connection problem. I'm getting that error message.
As I researched, I got to know that internet permission is categorized as normal permission which is not prompted to the user upon installation.
I built a second dummy app: Same issue with it... compiled directly to new phone but didn't work...it works in old phone...
Old phone: Samsung J7 Prime with Android 8.1
New Phone: Samsung J7 Pro with Android 9
Any idea or suggestion will be gladly helpful... Thank you!
in android 9 and above you have to set network Security Config
first of all in res package create xml package and in xml package create new xml resource file with network_security_config name
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
then in manifest in
android:networkSecurityConfig="#xml/network_security_config"
<uses-permission android:name="android.permission.INTERNET" />
Use debug APK instead of signed APK
please add permission on Manifest to give a permission of permission.INTERNET

Google Play services missing or without correct permission

currently I am doing the user registration class by using Firebase authentication. However, the logcat showed this error. May I know how to solve this? I have install google play services in SDK tools and added in manifest file. Thank you:)
error1: load_driver(/vendor/lib/egl/libGLES_emulation.so): dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so"
error2: Google Play services missing or without correct permission.
Error3: tid 3325: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
Editted: those problem arised due to the emulator, but as long as you installed google play service on the emulator, the problem will solve
Try running it on a real device, emulator tends to cause errors.

When i run android project on my android mobile samsung j7 prime, mobile can't give permission

Mobile can't give permission...
Allow USB debugging?
The computer's key fingerprint is:
CA:66:EB:D1:B0:EB:01:3B:CC6F:98:C6:2B:C5:61:E4
Always allow from this computer to cancel, ok or error
(because an aap is obscuring a permission request, setting can't verify your request)
Option 1: App settings > grant all permissions.
Option 2: Remove file manager.
Regarding your permission issue on your phone, the problem may be
caused by an app called "File manager" Either you can uninstall it, or if you want to keep it, go
in "Settings -> Applications -> Settings -> Draw over other apps" and
set the value to "No" for "File manager". If you don't find still...Go
to settings and search 'draw over other apps'. Restart the device.

Error while obtaining UI hierarchy XML file:com.android.ddmlib.SyncException: Remote object doesn’t exist

After launching the app in the emulator, I tried to locate the objects by uiautomateviewer, but when I tried to capture the screenshot it throws the error as
Error while obtaining UI hierarchy XML file:com.android.ddmlib.SyncException: Remote object doesn’t exist!.
I tied with the above steps like stopping the appium and tried to capture the sreen shot via UIautomatorviewer. But after stopping the appium server(Ctrl+C from command prompt) automatically the launched app in emulator gets terminated.
So because of this I can’t able to capture the screen shot and identify the obeject values.
Please help me to solve this issue.
Please try this :
kill the adb server and start it again.
sudo adb kill-server
sudo adb start-server

IllegalStateException: OrcaSharedPreferences used before initialized when calling openActiveSession on Facebook SDK 3.5

I've upgraded facebook SDK from 3.0 to 3.5. Testing on my devices was fine but I got these crash reports:
java.lang.IllegalStateException: OrcaSharedPreferences used before initialized
1at android.os.Parcel.readException(Parcel.java:1433)
2at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
3at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
4at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
5at android.content.ContentResolver.query(ContentResolver.java:370)
6at android.content.ContentResolver.query(ContentResolver.java:313)
7at com.facebook.Settings.getAttributionId(SourceFile:418)
8at com.facebook.AppEventsLogger.getSessionEventsState(SourceFile:684)
9at com.facebook.AppEventsLogger.logEvent(SourceFile:645)
10at com.facebook.AppEventsLogger.logEvent(SourceFile:641)
11at com.facebook.AppEventsLogger.logSdkEvent(SourceFile:537)
12at com.facebook.Session.logAuthorizationStart(SourceFile:1110)
13at com.facebook.Session.authorize(SourceFile:915)
14at com.facebook.Session.open(SourceFile:995)
15at com.facebook.Session.openForRead(SourceFile:388)
16at com.facebook.Session.openActiveSession(SourceFile:891)
17at com.facebook.Session.openActiveSession(SourceFile:830)
This happens when a user tries to log in to the app using facebook.
I read in: java.lang.IllegalStateException: Orca SharedPreferences used before initialized
That it might be a case where the user doesn't have facebook app installed on his phone, but I also tested this scenario on my phone and it just opens facebook web view for logging in as it should.
It sucks to upgrade an SDK to find new crashes on code that worked just fine. What can be the cause?
Thanks!
We got this as well by force stopping the Facebook app before launching our app (also on FB SDK 3.5)

Categories

Resources