SERVICE_VERSION_UPDATE_REQUIRED error using Firebase Analytics on Android - android

I want to integrate Firebase Analytics in my project.
I followed the Guide but it gives me this warning:
06-30 18:38:30.514 W/FA ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:30.888 W/FA ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:32.306 W/FA ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:32.338 W/FA ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:32.661 W/FA ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:39:32.680 W/FA ( 2091): Tasks have been queued for a long time
My project version is:
ext {
minSdkVersion = 17
targetSdkVersion = 23
compileSdkVersion = 23
compileSdkVersionS = 'Google Inc.:Google APIs:23'
supportVersion = '24.0.0'
buildToolsVersion = '23.0.2'
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7
gradleVersion = '2.1.2'
playServicesVersion = '9.2.0'
gsonVersion = '2.3'}
The log is print out through
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
I think the version I am using now is good enough but I am still getting the error message, can anyone give me a hint on it?

After posting comments on the question (see above), I experimented running an app built with Firebase 9.2.0 on an emulator that had an old version of Google Play Services. Using the adb commands posted in the question, I saw the same warnings as those included in the question. Also in the normal logcat output was the message:
W/GooglePlayServicesUtil: Google Play services out of date. Requires 9256000 but found 9080030
You need to update Google Play Services on your device. If you are running Firebase 9.2.0, the required Play Services version is 9.2.56.

This message means that you need to update Google Play Store app on the device.
If you are using Android Studio Emulator:
Open extended controls by clicking the 3 dots at the bottom of control menu
Select Google Play
Click Update
Inside the emulator click the UPDATE button
After the new version is downloaded and installed this error will be gone.

Related

An unknown server-side error occurred while processing the command. Could not proxy command to remote server. Original error: Error: socket hang up

If I ran TestNG test class it displays error ------------
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.
Original error: Could not proxy command to remote server. Original error: Error: socket hang up (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 281 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'MON-PC305', ip: '10.101.0.119', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.app.android.game.app, statBarHeight=84, noReset=false, viewportRect={top=84, left=0, width=1440, height=2308}, deviceName=emulator-5554, platform=LINUX, deviceUDID=emulator-5554, desired={app="app path", appPackage=com.app.android.game.app, appActivity=com.app.android.game.app.activities.login.riskWarningLogin.RiskWarningLoginActivity, noReset=false, automationName=uiautomator2, skipUnlock=true, platformName=Android, deviceName=emulator-5554}, platformVersion=9, webStorageEnabled=false, automationName=uiautomator2, takesScreenshot=true, skipUnlock=true, javascriptEnabled=true, platformName=Android, deviceApiLevel=28, deviceManufacturer=Google, app=C:\Users\***\eclipse-workspace\appname\app.apk, deviceScreenSize=1440x2560, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, appActivity=com.app.android.game.app.activities.login.riskWarningLogin.RiskWarningLoginActivity, pixelRatio=3.5, locationContextEnabled=false, deviceScreenDensity=560, deviceModel=Android SDK built for x86}]
Session ID: d275d496-08b0-4652-9aa9-67ae0476cdc8
Stop appium server and execute below commands
adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test
start appium server and execute your scripts ..it will work
I ran into an exact error but the resolution was I had to just restart both my Android emulator and also Appium server. After that everything started working.
Stop appium server and execute below commands
adb uninstall io.appium.uiautomator2.server adb uninstall io.appium.uiautomator2.server.test
This happens because you have opened 2 driver instances in your code.
URL url = new URL(Common.getProperty("URL"));
driver = new AndroidDriver<WebElement>(url, capabilities);
The above stuff. Make sure you have initialized it once only in your suit otherwise it will through the same error you faced.
I ran into exact same issue. Below are the quick solutions without uninstalling anything:
If you are using real device (Android). Remove the usb cable and
switch off or restart your Android device.
If you are using emulator (Android). Shut it down and restart
accordingly.
Connect your real device/emulator and run your test everything should be working accordingly
No sure if it is the same, but I meet similar problem on the vivo phone when I run appium automation via the uiautomator2. The appium error log is like
[debug] [W3C (9ae907c5)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (9ae907c5)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:261:13)
[HTTP] <-- POST /wd/hub/session/9ae907c5-5319-4f0b-92dc-fdaa47cfdcc5/element 500 139 ms - 530
The reason on my side of this issue is io.appium.uiautomator2.server be killed by the system process com.vivo.abe, cause I catch the following log from the logcat
02-29 09:43:32.236 1742 15589 I ActivityManager: Force stopping io.appium.uiautomator2.server appid=10271 user=0: stop by com.vivo.abe
02-29 09:43:32.236 701 701 E ANDR-IOP: IOP HAL: Received pkg_name = io.appium.uiautomator2.server pid = 0
02-29 09:43:32.237 1742 15589 I ActivityManager: Killing 28683:io.appium.uiautomator2.server/u0a271 (adj 0): stop by com.vivo.abe
02-29 09:43:32.239 701 701 E ANDR-IOP: IOP HAL: Received pkg_name = io.appium.uiautomator2.server pid = 0
The com.vivo.abe (name as Vivo Wisdom engine) is system app on vivo phone, which could not be uninstalled or force stop. There is one solution to resolve this issue, just add io.appium.uiautomator2.server to the white list, then the com.vivo.abe will not perform kill again to the app.
Method is Setting -> Battery -> High background power consumption , then add the io.appium.uiautomator2.server to the allow list.
After I perform the action, the io.appium.uiautomator2.server will not be killed again, and the automation script could run smoothly.
Hope this can give some reference to resolve the problem.
The following worked for me, I was using virtual device in android studio
Open Android Studio Click on Configure.
Click AVD Manager.
Click on the Dropdown on the right hand side of the virtual device.
Click on Cold Boot Now.
You're done! The device will restart within a couple of minutes.
reference:https://stackoverflow.com/a/68688915/20916414
I also faced the similar issue. When you run into such issue, you just need to run the following command on your terminal:
adb uninstall io.appium.uiautomator2.server.test
You'll get a terminal success response. Re-run your Appium server and it will work fine.
I found a workaround in the meantime: (I'm using javascript with webdriver.io, but you can adjust to other client languages, it's the same basically)
1.- Add the Full reset in Android Capabilities 'appium:fullReset': true,
2.- In afterEach Method delete the session await driver.deleteSession();
afterEach(async function () {
await driver.deleteSession();
},2);
3.- Add 2 retries when you init the driver, in my case is the beforeEach method
beforeEach(async function () {
driver = await getAppiumClient();
}, 2);
Then it will fail the first or second times with socket hang up error, but i'll be running the third and subsequent tests successfully.

How to see Google Analytics measurement protocol (debugging) through logcat or terminal in Android Studio

I have some issues about debugging Google Analytics Measurement Protocol through Android Studio, not so long ago I can use these commands:
adb shell setprop debug.firebase.analytics.app [-your app name-]
adb shell setprop log.tag.GAv4 DEBUG
adb logcat -v time -s GAv4
But now I cant do it anymore, is there any different way of doing it?
Usually the command lines above you can see log for enhanced ecommerce for GA such as:
Hit delivery requested: ht=1566372488197, _s=427, _v=ma18.3.85, a=563086223, adid=0e23f1fe-0bd9-45ab-9d4c-a059d6d55616, aid=app.myApp, aiid=com.android.vending, an=Moon, ate=1, av=32, cid=c9af35e1-2b9e-4785-b2d7-ab28acebb764, ea=Product Click, ec=Ecommerce, ni=false, pa=click, pal=New Product, pr1br=D & F, pr1ca=, pr1id=4792115, pr1nm=Gundam Exia, pr1pr=319920.0, pr1ps=0, sr=720x1280, t=event, tid=UA-128510179-8, ul=en-us, v=1
Showing that the Google Analytics is actually receiving the data correctly.
Now all I can see is this message in android studio:
19-09-05 17:34:29.462 3117-19610/? W/GAv4-SVC: Network compressed POST connection error: java.net.UnknownHostException: Unable to resolve host "ssl.google-analytics.com": No address associated with hostname
with ssl.google-analytics.com unresolved I don't think Charles proxy would work either.

Connected device [OFFLINE] - Session 'app': Error Installing APKs - existing connection was forcibly closed

When I trying to:
RUN > Select Deployment target > Select my Real Android device.
I after build my device disconnect automatically and Device status [OFFLINE]
EVENT LOG HERE:
2:40 PM Executing tasks: [:app:assembleDebug]
2:41 PM Gradle build finished with 1 warnings(s) in 7s 577ms
2:41 PM An existing connection was forcibly closed by the remote host
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:471)
at com.android.ddmlib.SplitApkInstaller.uploadApk(SplitApkInstaller.java:152)
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:78)
at com.android.ddmlib.Device.installPackages(Device.java:904)
at com.android.tools.idea.run.tasks.SplitApkDeployTask$SplitApkInstaller.installApp(SplitApkDeployTask.java:117)
at com.android.tools.idea.run.RetryingInstaller.install(RetryingInstaller.java:86)
at com.android.tools.idea.run.tasks.SplitApkDeployTask.perform(... (show balloon)
2:41 PM Session 'app': Error Installing APKs
And also sometime I found event log like this in Android Studio 2.3:
2:27 PM IllegalStateException
Android Studio could not interpret the results of the Gradle build correctly.
You may be able to recover from this issue by pressing 'Run' or 'Debug' again.
Please file a bug at b.android.com including this message and your idea.log (Help | Show Log in ..).
Session 'app': Error Launching activity .
Already Tried.
Disable Instant Run feature from settings.
Perform a clean build and run again.
Terminal window = start and stop adb server using this command "adb kill-server" and "adb start-server".
Enable and Disable USB Debugging.
-
Note: If I restart my device and Windows PC then it works but I can't restart every time so any one have better solutions for 'app': Error Installing APKs issues.
Please try with this - ADB Android Device Unauthorized.
This will work for you. if not then let me inform.

Using Google Analytics with FireBase + Google Tag Manager Android SDK

How to fire Google Analytics tag using Firebase + Google Tag Manager SDK in Android?
I added the Firebase container to my assets/container folder and created a Google Analytics tag using my GA Tracking id. I have followed exactly the steps as given in this tutorial: https://developers.google.com/tag-manager/ios/v5/#introduction
I trigger the appLaunch event with the below code:
mFirebaseAnalytics.logEvent("appLaunch", null);
How can I see this in my Google Analytics report? Please correct me if am wrong. Below are the logs printed when the above code is executed.
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase I/FA: Tag Manager is not found and thus will not be used
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase D/FA: Logging event (FE): appLaunch, Bundle[{_o=app}]
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase V/FA: Using measurement service
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase V/FA: Connecting to remote service
05-29 04:01:19.967 10378-10419/com.aiswarya.firebase D/FA: Connected to remote service
05-29 04:01:19.967 10378-10419/com.aiswarya.firebase V/FA: Processing queued up service tasks: 1
Thanks in Advance!
You should enable debug logging for both FirebaseAnalytics and Google Tag Manager and look at the logcat. It will likely answer your question.
You can enable Scion debug logs
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb shell setprop log.tag.GoogleTagManager VERBOSE
adb logcat -v time -s FA FA-SVC GoogleTagManager
View events in Android Studio debug log
TagManager is a separate library from Firebase Analytics. In order to use it in your app you need to add dependency on the tag manager form Google play services. When Firebase Analytics starts it will check for the presence of TagManager in the app and print message in logcat. If the message print TagManager not found you don't have the TagManager in your app. When TagManager is available you will see message like "TagManager found, initializing"
Google Tag Manager needs to be added as a separate dependency; see the documentation for doing so here:
Google Tag Manager for Android
In short:
Add to your module's gradle file:
dependencies {
// ...
implementation 'com.google.android.gms:play-services-tagmanager:[latest-version]'
}
Download the container file and add it to /assets/containers.

Android new android application project logcat errors

I just creates a new android application using eclipse.When I run the project it shows following errors in logcat
11-04 19:19:50.928: W/WearableConn(1441): Error writing to device, error: failed to connect to /10.0.2.2 (port 5601):
connect failed: ETIMEDOUT (Connection timed out)
11-04 19:19:50.988: I/WearableConn(1441): Socket closed
11-04 19:19:51.018: I/WearableConn(1441): Waiting 4.0 seconds to retry connection
11-04 19:19:55.068: I/WearableConn(1441): Connecting via TCP to /10.0.2.2:5601
11-04 19:20:00.028: I/ProcessStatsService(1237): Prepared write state in 6ms
Since I dont understand this I am a beginner need help?
Dont use wearable API (Api 20 4.4W). always use Api 19 4.4. bcoz android wearable is a completely different platform. u have to make app compatible with wearable (u can use targetSDK or compile SDK to be 20) but not for the wearable.
Do like this.
Go to command prompt and type as netstat and check whether port 5601 is open. if it is,then open another command prompt and type the following command telnet localhost 5554
once connected
type
redir add tcp:5601:6000
and quit
Hope this helps..

Categories

Resources