API Unknown Level Error When Trying to Run a Measurement Test

I tried to run the test on a device (non-handheld) that is connected via ethernet, but all I see is a failure. I use the gradle connectedAndroidTest task to run measurement tests and works fine on a portable device connected via USB directly to my computer. However, the same test could not be run even on a remote device. Error displayed: "No tests found." I used to see the same error if I run a test test without connecting any device, but Android Studio, as well as output from adb devicesshowed that the remote device is visible using the tool chain. Then I tried to run the same gradle task, but on the command line, with additional information. So I went in:
gradlew connectedAndroidTest --stacktrace --debug

In a bunch of debug output, I found a better description of the error:

[INFO] [org.gradle.api.Project] Bandwidth device "DEVICE_IP: 5555" for "AppNameHere:": Unknown API level
 [WARN] [org.gradle.api.Project]
 _FoundCompatibleDevices [TestRunner] FAILED

I searched for this error on google and I came across the source code that prints it. Therefore, I downloaded the source code of the Android platform platform to be able to navigate it more easily, and it seems to me that the API level was detected when reading the IDevice.PROP_BUILD_API_LEVEL property , which seems to be equal to "ro.build.version.sdk" . After a few more searches, I found that it should be defined in /system/build.prop. The contents of this file on the device showed me that it has the correct API level 19. And in fact, the same API level is shown in Android Studio, the Android tab, which shows the currently connected devices (and their logarithm output, open processes, etc. ), However, it seems that in some cases this value does not become correct.

Any idea where things might go wrong? Where can I look for a real problem? In the Android toolchain, Android on the device, during my investigation, something was done wrong?

Currently I am using:
 - Windows 7
 - Android Studio 1.1 Preview 1
 - Android SDK Tools 24.0.2
 - Android SDK Platform-tools 21
 - Android SDK Build-tools 19.1

+6
source share
4

, , robotium jenkins. , , , local.properties Android sdk. .

   sdk.dir=/usr/local/sdk

, ,

/pathToAndroidSdk/platform-tools/adb start-server

, . Ive , .

, .

+3

. , ,

while ! "$ANDROID_HOME/platform-tools/adb" shell getprop ro.build.version.sdk; do
  sleep 1
done

, .

: init.svc.bootanim Travis CI android-wait-for-emulator script. . , Android .

0

USB MIDI.

Samsung -> -> USB.

0

I encountered the same problem when setting up my REACT-NATIVE application on my physical Android device. I managed to install the application by switching "Select USB configuration" in the phone’s developer options to "RNDIS (USB ethernet)".

0
source

All Articles