Setting up Android environment with Selendroid

Hello.

I’m trying to set up this enviroment and when I click on Launch the Appium shows the following message:

<uses-permission android:name="android.**permission.INTERNET"/>
erro total
error: Could not pre-launch appium: Error: apk does not have INTERNET permissions. Selendroid needs internet permission to proceed, please check if you have <uses-permission android:name="android.**permission.INTERNET"/> in your AndroidManifest.xml

Here’s my configuration:

I’ve already checked my AndroidManifest.xml and I have this permission on it (detail here is that I use android.permission.INTERNET, without **).

I’ll appreciate any help given. Thanks!

2 Likes

Hmm, you shouldn’t have to do anything special. Are you using appium, and a related appium client? What do your desired capabilities look like?

I don’t know if I understand your first question, but yes, I’m using Appium client. And actually I don’t have desired capabilities yet, cause I can’t even Launch the server and start the emulator.

I’m seeing the same error starting today. Tried appium 1.2.3, 1.2.4 and 1.3 beta. The apk is not a problem - i believe something messed up during either

  • my upgrade from Maverics to Yosemite, or
  • updating command line tools to 6.1, or
  • updating android sdk tools

Do you have any insights?
Thanks!

Hmmm.
I’m using Mavericks.

We did a bit of investigation while using the same APK file.
All works with this setup: Maverics + Appium 1.2.4
Fails on Internet permission with: Yosemite + 1.2.4 (newer commandline tools as well)

Any clues? Our manifest includes the Internet permission.

This is what we’re posting:

info: --> POST /wd/hub/session {“desiredCapabilities”:{“automationName”:“selendroid”,“app”:"/Users/tiwanaku/Downloads/_mob/ConcurMobile-debug.apk",“platformName”:“android”,“deviceName”:“selendroid”,“browserName”:"",“app-package”:“com.concur.breeze”,“app-activity”:“com.concur.mobile.corp.activity.Startup”}}
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : app-package, app-activity
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] No appPackage desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: /Users/tiwanaku/Downloads/_mob/ConcurMobile-debug.apk

You want to use appActivity and appPackage. Camelcase not hyphenated.

Commandline tools 6.1 should be fine. Yosemite shouldn’t bother it either.

Okey, we will fix that. However - the root was elsewhere: android sdk, build tools version 21. All works just fine with version 20.

Have the same issue.
Appium 1.3.1
OS X 10.9.4
SDK 10/19/20/21

Same issue. All works perfect for Appium automationName and crashes with Selendroid…
Any solution?

Appium 1.2.3, OSX 10.10

I noticed the same problem here in my machine, and the RegExp whtin adb.js is not working for aapt 21.0.2 (My version).
Here when I run the same command the value for INTERNET permission is:
uses-permission: name=‘android.permission.INTERNET’
but the regex in adb.js is uses-permission:‘android.permission.INTERNET’.
So what you can do is edit the file adb.js in …/appium/node_modules/appium-adb/lib/adb.js
Method ADB.prototype.hasInternetPermissionFromManifest look for var hasInternetPermission = new RegExp
and change the value for “uses-permission: name=‘android.permission.INTERNET’”.
After changing the regex, it worked for me.

3 Likes

Massanori_Takaki, many thanks! That worked for me.
Just in case, the full path to adb.js for mac users (appium installed from npm):
/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/

Also I sent the bug report: https://github.com/appium/appium-adb/issues/58 in case if it’s bug )

How do I edit this file on Windows. If I use Notepad to edit adb.js, javascript tells me that there is an error on line 3. I then have to reinstall appium to recover from the second error.

Hi @Ernest,
Try to use Notepad++ instead of Notepad, and look for that string.

That works. Thank you.

I’m seeing this same behavior with the Appium 1.3.3 desktop app binary on OS X 10.9.5. If I downgrade the Android Build Tools package to version 20, everything works fine.