UIAutomator viewer - incorrect UI XML Snapshoot - java

I've downloaded the SDK to try the uiautomationviewer.bat. It is works fine with native apps like 'calculator':
But, it shows incorrect position of elements in some games, viewer just loose focus or so, for example:
Environment:
OS - Windows 7 Pro / Android 7.0
Real Device - Samsung A510F
Java - 1.8.0_151
Android Debug Bridge version - 1.0.39
SDK version - 26.0.1
uiautomatorviewer - 25.3.1
Is there some way to find out what is going on (probably logs)? How to get XML with correct position of elements on the not native apps in my case?

Related

How to setup an emulator running API 25 using a build matrix on Travis CI?

I am attempting to setup Travis CI so that it runs instrumentation tests on an emulator running API 25. Travis runs the tests to completion on API 4/10/19, but fails to startup the emulator for API 25, with the following message:
$ echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
Valid ABIs: no ABIs.
Error: Invalid --abi armeabi-v7a for the selected target.
The output of android list targets shows that the API 19 emulator has a Tag/ABI, whereas the API 25 emulator does not:
id: 7 or "android-19"
Name: Android 4.4.2
Type: Platform
API level: 19
Revision: 4
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : default/armeabi-v7a
id: 11 or "android-25"
Name: Android 7.1.1
Type: Platform
API level: 25
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : no ABIs.
How can I fix this so that the API 25 emulator launches and runs the tests?
The full .travis.yml file is as follows:
language: android
android:
components:
- tools
- platform-tools
- tools # appears twice as per Travis docs
- build-tools-23.0.1
- build-tools-25.0.2
- android-4
- android-10
- android-19
- android-23
- android-25
- extra-android-m2repository
- sys-img-armeabi-v7a-android-25
env:
matrix:
- ANDROID_TARGET=android-4 ANDROID_ABI=armeabi
- ANDROID_TARGET=android-10 ANDROID_ABI=armeabi
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
- ANDROID_TARGET=android-25 ANDROID_ABI=armeabi-v7a
before_script:
# Create and start emulator
- android list targets
- jdk_switcher use oraclejdk8
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- adb wait-for-device
- while [[ `adb shell pm path android` == 'Error'* ]]; do sleep 2; done
- adb shell input keyevent 82 &
script: ./gradlew --info connectedAndroidTest
sudo: false
Note: emulator version 26.1.4+ versions can introduce or fix bugs. If a reproducible ci build is required, the best option is to download the desired sdk-tools version no via android components.
Note: emulator version 26.1.3 is here including interesting fixes. I'm busy to revise my answer now:
Related issue using emulator 26.1.2 here. Relaunch last build like me to use 26.1.3 and pray, green
I am attempting to setup Travis CI so that it runs instrumentation
tests on an emulator running API 25. Travis runs the tests to
completion on API 4/10/19, but fails to startup the emulator for API
25...
How can I fix this so that the API 25 emulator launches and runs the
tests?
Update: I confirmed that ARM ABIs for APIs 23, 25 and 26 are also missing in Android Studio, so:
It's not a Travis-ci issue. I reproduced it locally as shown in the next image.
You can use ARM ABI for API-24. I forked your project and it worked in build #6 (next image).
You can use Google APIs image for API-25 as I explain below using the new sdkmanager: 1
You can use Google APIs image for API-25 using legacy tools if you know the img name: 1,2,3
We need to ask to Google or someone else why the ARM ABIs for these APIs are missing.
Update: A related bug was already reported to Google and discussed here, please, star it:
For some reason it's marked as being only available on windows. I'm
not sure if this is a problem with ADRT itself or the configuration
for this package, but from a quick look it seems like it's probably a
problem with adrt itself.
I'm not sure if the api-25 issue is related but I expect that it will work combining several solutions:
Use system images with google_apis to simplify the build matrix and avoid missing ABIs.
Use the new sdkmanager and avdmanager required by the recent Sdk Tools.
Use the new Trusty images including these tools to simplify the Travis-ci configuration or alternatively use dist: precise as explained here.
See the links below to working samples using a build matrix that includes Api-25 emulator.
I updated the api 23 system image one time on a macbook via Android Studio and appeared a message about the new version was not supported by my computer, so I use the google_apis one.
I offer a possible solution to the issue commented by Ashish Pathak (I'm also ardock) here.
I need to update my response to support the new Travis-ci images that comes with new SDK tools.
The new pre-installed Sdk Tools will simplify the solution and reduce the YAML file in size.
As announced in this blog post by Carmen Andoh and Dominic Jodoin on 19 Jun 2017:
Updates are coming to all Ubuntu Trusty 14.04 images
This new generation of Trusty images is already available in
production and can be used by adding group: edge in your .travis.yml
file:
sudo: required
dist: trusty
group: edge # Add this
And as explained here:
As a bit more information, this new Android image comes with:
Android SDK 25.2.3 build-tools-25.0.2
The new sdkmanager tool - a command line tool that allows you to view,
install, update, and uninstall packages for the Android SDK. Replaces
the previous android tool, see
https://developer.android.com/studio/tools/help/android.html
Also, the new Android image should be retro-compatible. See the full
list of Android SDK components that can be specified in the
.travis.yml file, including build-tools-26.0.0-preview.
But they are not using the new avdmanager, I'll try to fix it this weekend.
Alternatively, you can use the previous images by adding dist: precise.
The lines below are part of my answer on a related question: prior to the images update:
Full working sample using constraint-layout codelab repository for Android API level 22 to 25:
Two more samples using sdkmanager and avdmanager:
Android Maps Utils library - Google
Dexter library - Karumi
References
Official documentation related to Auto-download missing packages with Gradle
The new Emulator options are explained in Start the Emulator from the Command Line
avdmanager explained here replaces android avd since SDK tools version 25.3.0
sdkmanager explained here also enhanced to view and accept all licenses from the command line

New Android Application wont create an activity eclipse

When I select "New Android Application" and put in
- Minimum Required SDK:"API4: Android 1.6 (Donut)"
- Target SDK:"API4: Android 1.6 (Donut)"
- Complex With:"API4: Android 1.6 (Donut)"
- Theme:"None"
Then Next >> Next >> Next, it says in the "Create Activity", "This template requires a minimum SDK version of at least 7, the current min version is 4" so I installed the "Android 2.1 (Eclair)" because it said SDK version 7.
I go back again and I type:
- Minimum Required SDK:"API4: Android 1.6 (Donut)"
- Target SDK:"API7:Android 2.1 (Eclair)"
- Complex With:"Google ApIs (Google Inc.) (API7)"
- Theme:"None"
Then Next >> Next >> Next, I get the same msg!
I go back again and I put stuff and I got " This template requires a build target API version of at least 14, and the current version is 8" and many others but no use!
The question is, how can I make an application with some maps using Android 1.6?

Android project is not able to run. Showing errors

Everything was installed correctly. I am using Windows XP ,JDK 7.5 , Eclipse 4.2.
AVD is also setup correctly
When i run project it does not display it in a Virtual device.
This is the error I get:
[2012-08-05 11:49:09 - Emulator] WARNING: Data partition already in use. Changes will not persist!
[2012-08-05 11:49:09 - Emulator] WARNING: SD Card image already in use: E:\Documents and Settings\chamara\.android\avd\Gingabread1.avd/sdcard.img
[2012-08-05 11:49:09 - Emulator] ko:Snapshot storage already in use: E:\Documents and Settings\chamara\.android\avd\Gingabread1.avd/snapshots.img
Image 1
image2
It sounds like your emulator exited rather ungracefully and left everything locked up.
Look in your E:\Documents and Settings\chamara\.android\avd\Gingabread1.avd directory and delete any directory that ends with .lock. That should allow you to start up your virtual device again.
I do not know what the exact problem is, but try removing your SD card and reboot eclipse...

Phonegap application throws error running Android ICS 4.0, but works fine on Android 2.3 and below

I have a problem with PhoneGap mobile app running on Android. I am currently using PhoneGap version 1.3.0. And it works perfectly on Android 2.3 and all the lower versions of Android. However, when I try to run it on Android 4.0 - Ice cream sandwich it throws this dialog error:
Application error - A network error occurred. (file:///android_asset/www/index.html#)
In the logcat there is not much relevant info, only this:
chromium - Unknown chromium error: -6
Anybody has any idea why my app works fine on all Android versions except the newest 4.0 ICS ?
Thank you for any help in advance.
IIRC there is a bug in the 3.X versions of Android and it is probably in the 4.0 version as well. Try removing the # from your URL and things should work for you.

runtime error in android devices

I have created an app and it runs successfully in the emulator. When I was trying to run it in any of my devices it shows the following error:
[2011-02-12 09:57:06 - FirstImage] Android Launch!
[2011-02-12 09:57:06 - FirstImage] adb is running normally.
[2011-02-12 09:57:06 - FirstImage] Performing com.gis.image.FirstImage activity launch
[2011-02-12 09:57:23 - FirstImage] Uploading FirstImage.apk onto device 'HT96WKF01291'
[2011-02-12 09:57:32 - FirstImage] Installing FirstImage.apk...
[2011-02-12 09:57:52 - FirstImage] Re-installation failed due to different application signatures.
[2011-02-12 09:57:52 - FirstImage] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-02-12 09:57:52 - FirstImage] Please execute 'adb uninstall com.gis.image' in a shell.
[2011-02-12 09:57:52 - FirstImage] Launch canceled!
What is the issue and how can I overcome it?
You have installed this .apk before, and it was compiled using a different signature (see here for details). To fix this you need to remove the previous installation (you have to do that only when the signature has changed - not normally).
On the device itself, go Menu->Settings->Manage Applications. Select the application which you want to Uninistall, and click on the ‘Uninstall’ button. Now try your install.
When you install the application directly from eclipse it is signed by a different certificate than the one you use when you create the application for market.
What is most likely happening is that you have the app installed with a different signature than the one you are trying to install now.
Some times this happens, when you keep on installing the app through your code then it sometimes gives such kind of error..To over come this Just Open a terminal And paste this
adb uninstall com.gis.image
This is according to your Above error log...
You Just need to Uninstall your app from the Device.. Just like it :)
Hope this Helps....

Categories

Resources