Default method desugaring of io.appium.java_client.DefaultGenericMobileDriver failed because its super class org.openqa.selenium.remote.RemoteWebDriver is missing
I get the above error continuously when I started running the android studio for the initial setup of gradle. I checked on web, they say that environment variables for JAVA and Android SDK has to be set fine. I did that already. Is there is something else I wanna do?
Check whether the environment variable set is correct by typing "Javac" in command prompt.
C:\Users\VISHAL>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files and annotation processors
-cp <path> Specify where to find user class files and annotation processors
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
-processorpath <path> Specify where to find annotation processors
-parameters Generate metadata for reflection on method parameters
-d <directory> Specify where to place generated class files
-s <directory> Specify where to place generated source files
-h <directory> Specify where to place generated native header files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-profile <profile> Check that API used is available in the specified profile
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system
-Werror Terminate compilation if warnings occur
#<filename> Read options and filenames from file
if the problem is still there then try rebuilding it under a decent network connection or try reinstalling it with any installation guide video avaliable on Youtube.
Related
I am trying to build an executable for Android with cross compiling, everything works but the executable complains that it could not find the .so file it needs, which is in the same directory as the executable.
So what I did is to add the following lines
set(TARGET myapp)
# following 4 lines added to add RPATH of ./ to the binary
# so it searches the .so in the same directory
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_SKIP_RPATH FALSE)
set(CMAKE_INSTALL_RPATH $ORIGIN)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
# add source code to target
add_executable(${TARGET} src.cpp)
...
However, it builds the executable, but RPATH seems not working no matter how I play with the four lines above, I just could not find any RPATH info in the binary using readelf or objdump.
I also tried set_target_properties(${TARGET} PROPERTIES INSTALL_RPATH $ORIGIN) but still not working.
Did I miss use anything here for RPATH configuration?
update
just to note that if I build the app for host(Linux) (using the same cmake file except using the android ndk tool chain) then everything is fine, I see $ORIGIN in the binary RPATH using readelf.
although i dont know what is been done in android ndk tool chain
This is probably not what you want:
(I am mentioning it just to be complete with my answer)
I assume that $ORIGIN is an environment variable. If that is the case you need to explain to CMake that it is such an variable. You can use $ENV{VAR} to do this, e.g.:
set(CMAKE_INSTALL_RPATH $ENV{ORIGIN})
This is probably what you want:
Ofcourse if the variable is not accessible during CMake generation step. You can try to use bracket arguments, however I do not think that alone would work (see last note at the bottom). Bracket arguments [=[...]=] tell CMake to skip the evaluation, because $ is a special character. e.g.:
set(CMAKE_INSTALL_RPATH [=[$ORIGIN]=])
To understand what [=[]=] do here is a simple example:
set(FOO "bar")
message(STATUS ${FOO})
message(STATUS [=[${FOO}]=])
Should output
bar
${FOO} #<-- evaluation of ${FOO} was skipped
Also if I'm not mistaken you also need to pass $ORIGIN to linker with single quotes so that it doesn't get evaluated during linking, i.e.
'$ORIGIN'
#and not $ORIGIN
We're upgrading to Delphi 11.1 from 10.4.
We have a few scripts which build and deploy Android projects. They assemble an msbuild command that looked like this:
msbuild someproject.dproj /v:q /p:Platform=Android /t:Build;Deploy /p:Config=Release /p:BT_BuildType=AppStore
With 11.1, this throws an error message:
C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\CodeGear.Common.Targets(940,7): error MSB4036: The "XmlPeek" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v2.0.50727" directory. [someproject.dproj]
Now, C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\rsvars.bat, which is used by all of our build scripts, explicitly sets the .NET framework as below:
#SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319
#SET FrameworkVersion=v4.5
After some research, I hit on the idea of adding a toolsversion parameter to the msbuild command as below, and this worked:
msbuild someproject.dproj /v:q /p:Platform=Android /t:Build;Deploy /p:Config=Release /p:BT_BuildType=AppStore /toolsversion:4.0
This is all well and good, but I would prefer not to hard-code the toolsversion number in the script(s).
Is there a way I can programmatically obtain the correct value of the toolsversion that Delphi itself is using when it generates builds, etc.?
I assume that just finding the highest .NET version installed will not suffice (and even then, one has to "translate" that to a toolsversion). It has to marry up with whatever Delphi is doing (e.g., in the CodeGear.Common.Targets file referenced in the original error message).
This is a bug in Delphi 11.1 that has at least 3 bug reports: RSP-37855, RSP-38466, and RSP-38467.
You can add /tv:4.0 to your MSBuild command line, or modify the first line in the .dproj file to:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
Assuming that rsvars.bat has been run,
FOR %%v IN ("%frameworkdir%") DO SET "toolsversion=%%~nv"
ECHO msbuild ...blah... /toolsversion:%toolsversion:~1%
The variable frameworkdir will be set by rsvars.bat. The for command parses its value (eg. C:\Windows\Microsoft.NET\Framework\v4.0.30319 as though it is a filename, and picks v4.0 as the "filename" (~n modifier [filename] of the metavariable %%v)
Then use the value assigned to toolsversion, starting at character 1 (where the first character is "character 0")
--- Given more info in comment
FOR %%v IN ("%frameworkdir%") DO ECHO %%~nxv|FINDSTR /R ".*\..*\.">nul&IF ERRORLEVEL 1 (SET "toolsversion=%%~nxv") ELSE SET "toolsversion=%%~nv"
Oh ye of little faith :)
I am trying to add a strip debug symbols step for my Android library which includes native shared libraries for different ABIs, e.g. x86/native-lib.so, x86_64/native-lib.so, arm64-v8a/native-lib.so, etc.
I understand that the strip command must be respective to each ABI. So, I need to invoke the correct strip command, for which I need to know its correct path during build time.
For example, for ABI x86_64, I need to have below path setting:
set(STRIP ~/Library/Android/android-ndk-r16b/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-strip)
add_custom_command(TARGET ${SHARED_LIBRARY_NAME} POST_BUILD
COMMAND ${STRIP}
"${DIST_LIBS_DIR}/${LIB_BUILD_TYPE}/${ANDROID_ABI}/lib${SHARED_LIBRARY_NAME}.so"
COMMENT "Strip debug symbols done on final binary.")
The path I need is illustrated like below:
So, my questions are:
Is there an existing CMake variable to point at this path, i.e. /android-ndk-r16b/toolchains/???/prebuilt/???/bin/???-???-???-strip?
If not, is there a way to form this path utilising other known Android CMake variable, e.g. ANDROID_NDK, ANDROID_ABI, etc?
Thanks #Alex Cohn a lot for pointing out the file android.toolchain.cmake which usually exists at directory ~/Library/Android/sdk/cmake/cmake_version_xxx/android.toolchain.cmake on macOS.
There are many useful Android CMake variables already configured inside, e.g.
ANDROID_NDK
ANDROID_TOOLCHAIN
ANDROID_ABI
ANDROID_PLATFORM
ANDROID_STL
ANDROID_PIE
ANDROID_CPP_FEATURES
ANDROID_ALLOW_UNDEFINED_SYMBOLS
ANDROID_ARM_MODE
ANDROID_ARM_NEON
ANDROID_DISABLE_NO_EXECUTE
ANDROID_DISABLE_RELRO
ANDROID_DISABLE_FORMAT_STRING_CHECKS
ANDROID_CCACHE
And the one ANDROID_TOOLCHAIN_PREFIX is exactly what I looked for, so my final CMake script comes into below:
add_custom_command(TARGET ${SHARED_LIBRARY_NAME} POST_BUILD
COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose
"${DIST_LIBS_DIR}/${LIB_BUILD_TYPE}/${ANDROID_ABI}/lib${SHARED_LIBRARY_NAME}.so"
COMMENT "Strip debug symbols done on final binary.")
And I don't need to explicitly pass any additional arguments, i.e. DCMAKE_TOOLCHAIN_FILE=android.toolchain.cmake, from command line to the build process. Because, this file, i.e. android.toolchain.cmake, was already taken into account automatically by Android native build system.
You can use ${CMAKE_STRIP}. It is set appropriately when you use -DCMAKE_TOOLCHAIN_FILE=android.toolchain.cmake. I hope it is OK also if you work with 'built-in' Android support with supported NDK version.
I like to crosscompile Perl for the Android x86 emulator. But I got a PIE (position independent executables) error on running Configure... Based on this and this tutorial.
Specs:
NDK version 14
Perl 5.22.1.
x86 Android emulator built with AOSP - Android 7.1.1
I set following variables:
export ANDROID_NDK=/home/fabian/Android/Sdk/ndk-bundle
export TARGET_ARCH=x86
export ANDROID_TOOLCHAIN=/tmp/toolchain-x86
export SYSROOT=$ANDROID_TOOLCHAIN/sysroot
export TARGETDIR=/data/local/perl
export GCC=i686-linux-android-gcc
export PATH=$PATH:$ANDROID_NDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin
Then I build the toolchain with following command:
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-23 --install-dir=$ANDROID_TOOLCHAIN --toolchain=x86-4.9
and get this (correct?) output:
HOST_OS=linux
HOST_EXE=
HOST_ARCH=x86_64
HOST_TAG=linux-x86_64
HOST_NUM_CPUS=4
BUILD_NUM_CPUS=8
Auto-config: --arch=x86
Toolchain installed to /tmp/toolchain-x86.
Then I start the ./Configure command:
./Configure -des -Dusedevel -Dusecrosscompile -Dtargetrun=adb -Dcc=i686-linux-android-gcc -Dsysroot=$SYSROOT -Dtargetdir=$TARGETDIR -Dtargethost=emulator-5554
and got this output:
First let's make sure your kit is complete. Checking...
Would you like to see the instructions? [n]
Locating common programs...
Checking compatibility between /bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Using targetarch i686-linux-android.
Using targethost emulator-5554.
Building host miniperl and generate_uudmap binaries
Using targethost emulator-5554.
Guessing targetuser root.
Guessing targetport 22.
Using '/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/run-adb' for remote execution,
and '/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/from-scp' and '/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/to-scp'
for remote file transfer.
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
aix_3 dragonfly irix_4 nonstopux stellar
aix_4 dynixptx irix_5 openbsd sunos_4_0
aix dynix irix_6_0 opus sunos_4_1
altos486 epix irix_6_1 os2 super-ux
amigaos esix4 irix_6 os390 svr4
atheos fps isc_2 os400 svr5
aux_3 freebsd isc posix-bc ti1500
bitrig freemint linux-android powerux ultrix_4
bsdos genix linux qnx umips
catamount gnukfreebsd lynxos riscos unicosmk
convexos gnuknetbsd midnightbsd sco_2_3_0 unicos
cxux gnu mips sco_2_3_1 unisysdynix
cygwin greenhills mirbsd sco_2_3_2 utekv
darwin haiku mpc sco_2_3_3 uwin
dcosx hpux ncr_tower sco_2_3_4 vos
dec_osf i386 netbsd sco
dos_djgpp interix newsos4 solaris_2
Which of these apply, if any? [linux-android]
"./a.out": error: only position independent executables (PIE) are supported.
Aborted
You don't have an ELF gcc. I will use dld if possible. If you are
using a version of DLD earlier than 3.2.6, or don't have it at all, you
should probably upgrade. If you are forced to use 3.2.4, you should
uncomment a couple of lines in hints/linux.sh and restart Configure so
that shared libraries will be disallowed.
Disabling ndbm. This will generate a Whoa There message in Configure.
Read hints/linux.sh for further information.
Operating system name? [linux-android]
Operating system version? [7.1.1]
Installation prefix to use? (~name ok) [/usr/local]
AFS does not seem to be running...
What installation prefix should I use for installing files? (~name ok)
[/usr/local]
Getting the current patchlevel...
Build a threading Perl? [n]
Build Perl for multiplicity? [n]
Use which C compiler? [i686-linux-android-gcc]
Checking for GNU cc in disguise and/or its version number...
"./try": error: only position independent executables (PIE) are supported.
Aborted
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches?
[/tmp/toolchain-x86/sysroot/usr/lib/../lib /tmp/toolchain-x86/sysroot/usr/lib]
What is the file extension used for shared libraries? [sa]
Make shared library basenames unique? [n]
Hmm. Based on the hints in hints/linux-android.sh,
the recommended value for $d_libname_unique on this machine was "define"!
Keep the recommended value? [y]
Build Perl for SOCKS? [n]
Try to use long doubles if available? [n]
Checking for optional libraries...
What libraries to use? [-lm -lc]
What optimizer/debugger flag should be used? [-O2]
Any additional cc flags?
[-DOVR_DBL_DIG=14 --sysroot=/tmp/toolchain-x86/sysroot]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)?
[ --sysroot=/tmp/toolchain-x86/sysroot]
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:
#include
int main() { printf("Ok\n"); return(0); }
I used the command:
i686-linux-android-gcc -o try -O2 -DOVR_DBL_DIG=14 --sysroot=/tmp/toolchain-x86/sysroot --sysroot=/tmp/toolchain-x86/sysroot try.c -lm -lc
/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/run-adb-shell ./try
and I got the following output:
The program compiled OK, but exited with status 134.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.
OK I have to set the flags
Modify config.sh to enable PIE support. Append “-fPIE” to ccflags and
“-fPIE -pie” to ldflags. Then rerun configure to ensure this is
applied.
But there is no config.sh in the perl folder, so I tried this ./Configure command:
`./Configure -des -Dusedevel -Dusecrosscompile -Dtargetrun=adb -Dcc=i686-linux-android-gcc -Dsysroot=$SYSROOT -Dtargetdir=$TARGETDIR -Dtargethost=emulator-5554 -Dccflags='-fPIE' Dldflags='-fPIE -pie'`
but same problem again...
First let's make sure your kit is complete. Checking...
Would you like to see the instructions? [n]
Locating common programs...
Checking compatibility between /bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Using targetarch i686-linux-android.
Using targethost emulator-5554.
Building host miniperl and generate_uudmap binaries
Using targethost emulator-5554.
Guessing targetuser root.
Guessing targetport 22.
Using '/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/run-adb' for remote execution,
and '/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/from-scp' and '/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/to-scp'
for remote file transfer.
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
aix_3 dragonfly irix_4 nonstopux stellar
aix_4 dynixptx irix_5 openbsd sunos_4_0
aix dynix irix_6_0 opus sunos_4_1
altos486 epix irix_6_1 os2 super-ux
amigaos esix4 irix_6 os390 svr4
atheos fps isc_2 os400 svr5
aux_3 freebsd isc posix-bc ti1500
bitrig freemint linux-android powerux ultrix_4
bsdos genix linux qnx umips
catamount gnukfreebsd lynxos riscos unicosmk
convexos gnuknetbsd midnightbsd sco_2_3_0 unicos
cxux gnu mips sco_2_3_1 unisysdynix
cygwin greenhills mirbsd sco_2_3_2 utekv
darwin haiku mpc sco_2_3_3 uwin
dcosx hpux ncr_tower sco_2_3_4 vos
dec_osf i386 netbsd sco
dos_djgpp interix newsos4 solaris_2
Which of these apply, if any? [linux-android]
"./a.out": error: only position independent executables (PIE) are supported.
Aborted
You don't have an ELF gcc. I will use dld if possible. If you are
using a version of DLD earlier than 3.2.6, or don't have it at all, you
should probably upgrade. If you are forced to use 3.2.4, you should
uncomment a couple of lines in hints/linux.sh and restart Configure so
that shared libraries will be disallowed.
Disabling ndbm. This will generate a Whoa There message in Configure.
Read hints/linux.sh for further information.
Operating system name? [linux-android]
Operating system version? [7.1.1]
Installation prefix to use? (~name ok) [/usr/local]
AFS does not seem to be running...
What installation prefix should I use for installing files? (~name ok)
[/usr/local]
Getting the current patchlevel...
Build a threading Perl? [n]
Build Perl for multiplicity? [n]
Use which C compiler? [i686-linux-android-gcc]
Checking for GNU cc in disguise and/or its version number...
"./try": error: only position independent executables (PIE) are supported.
Aborted
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches?
[/tmp/toolchain-x86/sysroot/usr/lib/../lib /tmp/toolchain-x86/sysroot/usr/lib]
What is the file extension used for shared libraries? [sa]
Make shared library basenames unique? [n]
Hmm. Based on the hints in hints/linux-android.sh,
the recommended value for $d_libname_unique on this machine was "define"!
Keep the recommended value? [y]
Build Perl for SOCKS? [n]
Try to use long doubles if available? [n]
Checking for optional libraries...
What libraries to use? [-lm -lc]
What optimizer/debugger flag should be used? [-O2]
Any additional cc flags?
[-DOVR_DBL_DIG=14 -fPIE --sysroot=/tmp/toolchain-x86/sysroot]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)?
[ --sysroot=/tmp/toolchain-x86/sysroot]
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:
#include
int main() { printf("Ok\n"); return(0); }
I used the command:
i686-linux-android-gcc -o try -O2 -DOVR_DBL_DIG=14 -fPIE --sysroot=/tmp/toolchain-x86/sysroot --sysroot=/tmp/toolchain-x86/sysroot try.c -lm -lc
/home/fabian/Desktop/Testimages/perl-5.22.1/Cross/run-adb-shell ./try
and I got the following output:
"./try": error: only position independent executables (PIE) are supported.
Aborted
The program compiled OK, but exited with status 134.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.
But now the ccflag is set how you can see in the last lines...
Did I miss something?
I know of
ant coverage
However that does a few things, it compiles with emma instrumentation, installs, and runs the test apk. I don't want it to run the test suite through ant with coverage because I need to run it with some extra hooks, and I don't want to run the large test suite twice. So far I have tried this
Target_Project/build.properties
emma.enabled=true
Test_Project/build.properties
emma.enabled=true
Then in in a shell I execute this.
Target_Project$ ant debug
Target_Project$ adb install bin/Target_Project-debug.apk
Target_Project$ cd ../Test_Project/
Test_Project$ ant debug
Test_Project$ adb install bin/Test_Project-debug.apk
Test_Project$ adb shell am instrument -e coverage true -e coverageFile /sdcard/myFile.ec -w com.my_app.testproject/android.test.InstrumentationTestRunner
The response is
Error: Failed to generate emma coverage. Is emma jar on classpath?
So is there a trick to getting the apk to build with the emma libs? I tried invoking the targets created in the sdk xml templates but they are "private." Is there something I am missing?
Well for anyone interested. The SDK documentation is completely busted (surprising I know). Basically you have to do this,
take the base build.xml generated by android create-project and change the tag
<setup/>
and change it to
<setup import="false"/>
Now the documentation will tell you to copy from SDK/platform-/templates/android_rules.xml and place that into your build.xml ...
THIS IS WRONG and horribly unmaintained. This rules file isn't used by anything. What is used are the rules inside of SDK/tools/ant/. Grab the appropriate file for your type of project (library for a library project, test for a test project, or vanilla for a regualr project) with the latest _r and
copy the contents of it's root node into your build.xml. Insert it after the setup tag. If you don't use the files inside the ant directory, you will not be able to compile project libraries through the ant script. I was so glad they maintained documentation on how to do this.
Now you can change whatever you like in the build file to match your build needs. In which case I just made install-helper call my wrapper around adb which returns interpreted resultcodes.
// coverage.py
development\testrunner\coverage.py
def TestDeviceCoverageSupport(adb):
"""Check if device has support for generating code coverage metrics.
This tries to dump emma help information on device, a response containing
help information will indicate that emma is already on system class path.
Returns:
True if device can support code coverage. False otherwise.
"""
try:
output = adb.SendShellCommand("exec app_process / emma -h")
if output.find('emma usage:') == 0:
return True
except errors.AbortError:
pass
return False
adb shell exec app_process / eamm -h
build core images
http://duykham.blogspot.com/2009/09/how-to-get-emma-code-coverage-of.html