RemoteWebDriver+AndroidDriver : error communicating with browser - android

I've recently started working with -> RemoteWebDriver+AndroidDriver . I've started with a basic example as follows:
stmt1:WebDriver driver=new AndroidDriver();
stmt2:driver.get("http://www.google.com");
stmt3:WebElement element = driver.findElement(By.name("q"));
stmt4:element.sendKeys("Cheese!");
'stmt1','stmt2' opens google.com successfully on the emulator .
The issue is that 'stmt3' & 'stmt4' don't work .Emulator closes webdriver and following exception is generated in eclipse :
org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died.
Build info: version: '2.12.0', revision: '14666', time: '2011-11-10 18:36:18'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_33'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:412)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:205)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:254)
at org.openqa.selenium.By$ByName.findElement(By.java:286)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:197)
at androidpackage.Androidclass$1.apply(Androidclass.java:24)
at androidpackage.Androidclass$1.apply(Androidclass.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:189)
at androidpackage.Androidclass.testAndroid(Androidclass.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.http.NoHttpResponseException: The target server failed to respond
at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:101)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:464)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:391)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:370)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:398)
... 27 more

From the stacktrace, it seems your selenium version is 2.12.0. The current version is 2.25.0. Probably using latest could solve the problem.

Problem was that I used android 2.3.3 (bug on Gingerbread might have caused WebDriver to crash). On upgrading to android 4.0.3 the code runs fine.

Related

Exception in plugin AppDynamics Android Agent Installer 1.1.38

I am unable to install the plugin AppDynamics Android Agent Installer from the marketplace of android studio. I'm getting below exception stack trace.
java.lang.NoClassDefFoundError: com/android/tools/idea/gradle/parser/GradleBuildFile
at com.appdynamics.androidstudioplugin.installer.BuildGradleFinder.findBuildGradle(BuildGradleFinder.java:19)
at com.appdynamics.androidstudioplugin.screens.ScreenController.setChosenModule(ScreenController.java:122)
at com.appdynamics.androidstudioplugin.screens.ModulePickerScreen$2.mouseClicked(ModulePickerScreen.java:196)
at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
at java.desktop/java.awt.Component.processEvent(Component.java:6419)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:971)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:906)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:838)
at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:451)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:808)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:505)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.android.tools.idea.gradle.parser.GradleBuildFile PluginClassLoader[PluginDescriptor(name=AppDynamics Android Agent Installer, id=com.appdynamics.androidstudioplugin, path=C:\Users\Administrator\AppData\Roaming\Google\AndroidStudio4.2\plugins\plugin, version=1.1.38)] com.intellij.ide.plugins.cl.PluginClassLoader#405b4138
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:95)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 42 more
I tried changing Gradle versions but still tucked here.
Here are my project configurations
Android Gradle plugin version : 3.2.1
Gradle version : 4.8.1
Kotin version : 1.3.11
Target & Compatible JDK : Java 8
I also have some screenshots attached.
This is likely due to using a newer version of Android Studio then is supported with the "Android Agent Installer" methodology:
"Android Studio 2.1.0 - 2.9.9, 3.2.1 - 3.9.9 (Not supported: 3.0.0 - 3.2.0, 4.0)" - from https://docs.appdynamics.com/21.9/en/end-user-monitoring/mobile-real-user-monitoring/instrument-android-applications/instrument-an-application-with-the-android-agent-installer
Instead, follow these instructions to build using Gradle with the latest version: https://docs.appdynamics.com/21.9/en/end-user-monitoring/mobile-real-user-monitoring/instrument-android-applications/instrument-an-android-application-manually#InstrumentanAndroidApplicationManually-gradle-android-studio

Displaying an error as "app " option required to reinstall while the appium program

I am getting exception while running appium program. Please ask if extra information needed.
TLDR:
original error: 'app' option is required for reinstall
log4j:WARN No appenders could be found for logger
(org.apache.http.client.protocol.RequestAddCookies). log4j:WARN Please
initialize the log4j system properly. log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" org.openqa.selenium.WebDriverException: An
unknown server-side error occurred while processing the command.
Original error: 'app' option is required for reinstall Build info:
version: '3.8.1', revision: '6e95a6684b', time:
'2017-12-01T19:05:14.666Z' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version:
'6.1', java.version: '1.8.0_151' Driver info: driver.version:
AndroidDriver remote stacktrace: UnknownError: An unknown server-side
error occurred while processing the command. Original error: 'app'
option is required for reinstall
at getResponseForW3CError (C:\Users\preethi.g\AppData\Local\appium-desktop\app-1.10.0\resources\app\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\preethi.g\AppData\Local\appium-desktop\app-1.10.0\resources\app\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37)
at process._tickCallback (internal/process/next_tick.js:68:7) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
at
org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
at
org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at
java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at
java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown
Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at
java.util.stream.ReferencePipeline.findFirst(Unknown Source) at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at
io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at
io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at
io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at
io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at
io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at Mobileapp1.Apptesting.main(Apptesting.java:24)
It seems like you did not add "app" capability in your DesiredCapability and you are using noReset capability. You can add "app" capability and give .ipa or .apk file location.
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.APP, "path to ipa/apk file" );
//others capabilities

Android Studio 3.0 rc2: Android Device Monitor failed to open

I've recently updated my Android Studio to 3.0 rc2 using Beta channel of the update section inside the application.
Today I wanted to use Android Device Monitor where an exception happened and saved to log inside sdk folder.
The log is this:
!SESSION 2017-10-28 19:28:26.756 -----------------------------------------------
eclipse.buildId=unknown
java.version=9-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64 -data #noDefault
!ENTRY org.eclipse.osgi 4 0 2017-10-28 19:28:27.267
!MESSAGE error loading hook: org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator
!STACK 0
java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module #4abdb505
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source)
at java.base/java.lang.reflect.Method.setAccessible(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findMethod(BaseStorage.java:174)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findMethod(BaseStorage.java:181)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findAddURLMethod(BaseStorage.java:165)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.<init>(BaseStorage.java:135)
at org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator.addHooks(BaseHookConfigurator.java:24)
at org.eclipse.osgi.baseadaptor.HookRegistry.loadConfigurators(HookRegistry.java:178)
at org.eclipse.osgi.baseadaptor.HookRegistry.initialize(HookRegistry.java:100)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.<init>(BaseAdaptor.java:98)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.createAdaptor(EclipseStarter.java:737)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:258)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
!ENTRY org.eclipse.osgi 4 0 2017-10-28 19:28:27.309
!MESSAGE Startup error
!STACK 1
java.lang.NullPointerException
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:262)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
I don't know how to handle this error and I need a way around.
I'll be glad with any suggestion to solve it without mentioning "download stable version" and downgrade.
UPDATE: After I tried to update to Stable version through the Stable channel of update section I get error that some files missing
gradle/m2repository/com/android/java/
gradle/m2repository/com/android/java/tools/
gradle/m2repository/com/android/java/tools/build/
gradle/m2repository/com/android/java/tools/build/java-lib-model-builder/
gradle/m2repository/com/android/java/tools/build/java-lib-model/
I'm trying to update every single module so maybe I could solve this issue
UPDATE-2: After cancelling previous error and running the Android Studio, It seems to be updated but the error is still there, here is the error after updating to Stable version:
!SESSION 2017-10-28 19:55:04.560 -------------------------------------------
----
eclipse.buildId=unknown
java.version=9-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64 -data #noDefault
!ENTRY org.eclipse.osgi 4 0 2017-10-28 19:55:04.922
!MESSAGE error loading hook: org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator
!STACK 0
java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module #4abdb505
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source)
at java.base/java.lang.reflect.Method.setAccessible(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findMethod(BaseStorage.java:174)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findMethod(BaseStorage.java:181)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findAddURLMethod(BaseStorage.java:165)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.<init>(BaseStorage.java:135)
at org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator.addHooks(BaseHookConfigurator.java:24)
at org.eclipse.osgi.baseadaptor.HookRegistry.loadConfigurators(HookRegistry.java:178)
at org.eclipse.osgi.baseadaptor.HookRegistry.initialize(HookRegistry.java:100)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.<init>(BaseAdaptor.java:98)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.createAdaptor(EclipseStarter.java:737)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:258)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
!ENTRY org.eclipse.osgi 4 0 2017-10-28 19:55:04.959
!MESSAGE Startup error
!STACK 1
java.lang.NullPointerException
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:262)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
UPDATE-3: After A LOT of searching, I found a solution but it's not the answer so I added this update to question.
I can run the Android device monitor manually by going to /sdk/tools/ and run the monitor.bat file by cmd or powershell and now I have access to this feature, but even now, the Android Studio can't open it for me!!!!
Please if anyone can help me post an answer telling me a workaround this problem.
After a lot of try and catch! I finally fixed the issue.
Android Studio 3.0 is not fully support JDK 9
After installing JDK 8 on my system and set it as JAVA_HOME variable and restarting the system everything is working now.
I got it because I wanted to install Nativescript and I couldn't cause it only supports JDK 8. that was my first clue
Set JAVA_HOME variable to JDK 8 directory and everything will be okay
If you are on windows try opening your Android Studio in Administrative Mode (Run as administrator)

Unable to generate cloud end point client library

I'm building an app that uses GAE using this tutorial and I'm trying to generate a Cloud end point library for a class as explained here.
However, I'm getting an unexpected error. Here are the details:
eclipse.buildId=v22.6.2-1085508
java.version=1.7.0_55
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_IN
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product com.android.ide.eclipse.adt.package.product
Error
Thu Jun 05 20:24:00 IST 2014
Unexpected Exception
java.lang.reflect.InvocationTargetException
at com.google.gdt.eclipse.appengine.swarm.wizards.GenerateSwarmApiAction$1.run(GenerateSwarmApi Action.java:82)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.ClassNotFoundException: com.google.api.server.spi.tools.ClientLibGenerator$Language
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createClientLibFromApiConfig(SwarmApiCreator.java:113)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createSwarmApi(SwarmApiCreator.java:258)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:444)
at com.google.gdt.eclipse.appengine.swarm.wizards.GenerateSwarmApiAction$1.run(GenerateSwarmApiAction.java:80)
... 1 more
Root exception:
java.lang.ClassNotFoundException: com.google.api.server.spi.tools.ClientLibGenerator$Language
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createClientLibFromApiConfig(SwarmApiCreator.java:113)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createSwarmApi(SwarmApiCreator.java:258)
at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:444)
at com.google.gdt.eclipse.appengine.swarm.wizards.GenerateSwarmApiAction$1.run(GenerateSwarmApiAction.java:80)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Eclipse version I'm using is 4.3.
I am facing the same problem. But, I have found this link and I think it can help:
http://mall.51zks.com/Problem/index/-190279264/generating-the-api-metadata-for-cloud-endpoints-classes-failed/
It basically links forward to this link, which tells how to create the endpoint library using command line too:
https://developers.google.com/appengine/docs/java/endpoints/endpoints_tool
I am working on this solution now. If I get any good news, I will update.
As described in Google bugtracker this is a known bug, you must either downgrade to 1.9.3 or upgrade plugin tools to 3.6.0
see: https://code.google.com/p/google-plugin-for-eclipse/issues/detail?id=278

Selendroid working with Skype apk; not with other apps

Need your help with selendroid. Am a new to it and still learning the tricks.
Tried with the basic selendroid app example and the same with Skype apk, it worked perfectly.
However, when tried with other app's apk like tripadvisor and dropbox, I keep getting error.
Following is my code and the error from console . Am using the version details from the manifest xml.
On further exploration -
I compared the manifest xml file of skype, dropbox, etc ... and see permission tag with protection level as 'Signature' for dropbox, tripadvisor. However the same is not present in the skype manifest file. Could this be hindering with our code.
If so, is there any workaround?
Any help with this is much appreciated.
Code -
package testSelendroid;
import java.net.URL;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import io.selendroid.device.DeviceTargetPlatform;
import org.openqa.selenium.WebDriver;
public class selendroidNativeAppTest {
public static void main(String Args[])
{
WebDriver driver = null ;
//Below versions from Manifest files
//com.skype.raider:3.2.0.6673
//com.dropbox.android:2.3.8
//io.selendroid.testapp:0.10.0
SelendroidCapabilities caps = new SelendroidCapabilities("com.dropbox.android:2.3.8") ;
System.out.println("I am here");
caps.setPlatformVersion(DeviceTargetPlatform.ANDROID19);
System.out.println("I just reached here");
caps.setEmulator(true);
System.out.println("Passed emulator");
//caps.setCapability(CapabilityType.BROWSER_NAME, "Android");
//caps.setCapability("app-package", "com.tripadvisor.tripadvisor:8.7.1-release");
try {
System.out.println("Let me try");
driver = new SelendroidDriver(new URL("http://localhost:4444/wd/hub"), caps);
System.out.println("Driver ...");
driver.switchTo().window("NATIVE_APP");
System.out.print("Got the app");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Console -
I am here
I just reached here
Passed emulator
Let me try
org.openqa.selenium.SessionNotCreatedException: Error occurred while starting selendroid-server on the device
io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
at io.selendroid.android.impl.AbstractDevice.startSelendroid(AbstractDevice.java:235)
at io.selendroid.server.model.SelendroidStandaloneDriver.createNewTestSession(SelendroidStandaloneDriver.java:290)
at io.selendroid.server.handler.CreateSessionHandler.handle(CreateSessionHandler.java:42)
at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServlet.java:142)
at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:70)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.PathMatchHandler.handleHttpRequest(PathMatchHandler.java:33)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.DateHeaderHandler.handleHttpRequest(DateHeaderHandler.java:21)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.ServerHeaderHandler.handleHttpRequest(ServerHeaderHandler.java:25)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:67)
at org.webbitserver.netty.NettyHttpChannelHandler$2.run(NettyHttpChannelHandler.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Throwable: android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
Details:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation target package: com.dropbox.android
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
... 20 more
Command duration or timeout: 320.45 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'ECXIPSAGT6504', ip: '172.25.2.91', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51'
Driver info: io.selendroid.SelendroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at io.selendroid.SelendroidDriver.<init>(SelendroidDriver.java:63)
at testSelendroid.selendroidNativeAppTest.main(selendroidNativeAppTest.java:36)
Caused by: io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
at io.selendroid.android.impl.AbstractDevice.startSelendroid(AbstractDevice.java:235)
at io.selendroid.server.model.SelendroidStandaloneDriver.createNewTestSession(SelendroidStandaloneDriver.java:290)
at io.selendroid.server.handler.CreateSessionHandler.handle(CreateSessionHandler.java:42)
at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServlet.java:142)
at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:70)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.PathMatchHandler.handleHttpRequest(PathMatchHandler.java:33)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.DateHeaderHandler.handleHttpRequest(DateHeaderHandler.java:21)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.ServerHeaderHandler.handleHttpRequest(ServerHeaderHandler.java:25)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:67)
at org.webbitserver.netty.NettyHttpChannelHandler$2.run(NettyHttpChannelHandler.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Throwable: android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
Details:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation target package: com.dropbox.android
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
... 20 more
Check the SelendroidCapabilities id.
First run the server then go to Browser and run localhost URL at 4444 port
And if the Server returns the valid JSON then check the application ID and paste it into your
SelendroidCapabilities("com.dropbox.android:2.3.8")
Then run the JAVA project.
You will get rid from this problem.
If you still find any problem. tell me
Best luck

Categories

Resources