the requested application under test is not configured in selendroid server - android

#BeforeSuite
public void setUp() throws Exception {
//Start selendroid-standalone during test
SelendroidConfiguration config = new SelendroidConfiguration();
// Add the selendroid-test-app to the standalone server
config.addSupportedApp("F:\\Seleandriod\\OFCOne.apk");
//start the standalone server
SelendroidLauncher selendroidServer = new SelendroidLauncher(config);
selendroidServer.launchSelendroid();
// Create the selendroid capabilities
SelendroidCapabilities capa = new SelendroidCapabilities();
// Specify to use selendroid's test app
capa.setAut("io.selendroid.androiddriver:0.11.0");
// Specify to use the Android device API 19
capa.setPlatformVersion(DeviceTargetPlatform.ANDROID19);
// Don't request simulator, use real device
capa.setEmulator(false);
//capa.wait(10000000);
// Create instance of Selendroid Driver
driver = new SelendroidDriver(capa);
We are using HYBRID cordova app,
the execution fails at the line where SelendroidDriver(capa); is getting initialized with the following error:
"The requested application under test is not configured in selendroid
server"
We are using selendroid-standalone-0.11.0-with-dependencies version.
We have run on command line:
java -jar selendroid-standalone-0.11.0-with-dependencies -aut OFCOne.apk
Its giving following error:
"SEVERE: Error building server: The base package name of the apk
resigned-OFCOne.apk cannot be extracted."
please give me some suggestion to resolve this error.

capa.setAut("io.selendroid.androiddriver:0.11.0");
Here should be your appId not the appId for the selendroid. Most probably your appId will be your_app_package_name:version. Using
http://localhost:4444/wd/hub/status you can get your appId and the first appId is not your appId it is the appId for selendroid server driver app being installed on your device. The second appId will be your appId. Please use it instead what you have used in he above line of code.

I just have met the same issue. The reason is wrong path to your .apk file. And I not sure about absolute path, I used relative path
config.addSupportedApp("src/resources/myapp.apk");
Hope this help!

Related

Expo build apk : ExponentToken not generated

I created my first expo app, who can send notification to multiple users. I use the expo-notification package to generate the ExponentToken and handle incoming notification.
Everythings works perfecly when I use the expo go app, but recently I build my app in apk with eas
$ eas build -p android --profile genAPK
//the genAPK profile :
build: {
"genAPK":{
"android": {
"buildType":"apk"
}
}
}
I downloaded the builded apk, but when my real app want to generate the ExponentToken it just not works and return me a empty string... (I know it because my app crash do a alert() if the token is empty)
I don't know if this help, but I dont use the firebase way, I use the expo node sdk and my own database and API to store tokens and send notifications
Is this a common mistake and how can I fix this ?
Or at least can I see the output of my package even if this is a apk ?
Thanks in advance
My notification is also not working when i upgrade to EAS.
And i found this in Expo discord group:
No experienceId or projectId found. If one or the other can't be inferred from the manifest (eg. in bare workflow), you have to pass one in yourself.
at http://192.168.7.186:8081/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:102608:321 in _createSuperInternal
at node_modules/expo-modules-core/build/errors/CodedError.js:10:8 in constructor
at http://192.168.7.186:8081/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:313197:49 in getExpoPushTokenAsync$
There is a problem with ExpoPushToken, and you can see the source of this error from here expo-notifications-repo. The cause of this error in my case is the projectId, because in the expo-notifications-repo they use expo-constant package which have change in the latest SDK. So i need to add projectId to my app.json
"extra":{
"eas":{
"projectId":"(PROJECT_ID-Expo.dev)"
}
}

How to move to Realm Sync Protocol Version 3 for Android?

I am new to Realm and Android development and am trying to query a document from Atlas. I am able to successfully authenticate users, but when I try to perform a query, I get the following error: E/REALM_JAVA: Session Error[wss://realm.mongodb.com/]: WRONG_PROTOCOL_VERSION(realm::sync::ProtocolError:105): sync client must have a sync protocol version of at least 3 to sync on this application, but found version 2. Please update your application to use a newer SDK
I am currently working on version 10.4.0 of the Android Realm SDK and Android SDK Platform 30. I have tried looking for updates for both and it says that everything is up to date. Here is my code:
app.loginAsync(emailPasswordCredentials, it -> {
if (it.isSuccess()) {
Log.v("AUTH", "Successfully authenticated using an email and password.");
User user = app.currentUser();
String partitionValue = "object_id";
SyncConfiguration config = new SyncConfiguration.Builder(
user,
partitionValue)
.allowQueriesOnUiThread(true)
.allowWritesOnUiThread(true)
.build();
uiThreadRealm = Realm.getInstance(config);
//Debugging - testing Realm Sync queries
Products product = uiThreadRealm.where(Products.class).equalTo("_id", 4).findFirst();
if (product != null) {
Log.v("AUTH", product.toString());
}
Log.v("AUTH", config.toString());
//In-App functions
}
Does anyone have any way to solve this issue?
In my case it was due to selecting UUID as the type of one my fields, which is "at this time is NOT a supported type in the SDK, but it will be in a future version." (from Monogo's support).
For those coming from react-native and get this kind of error
sync client must have a sync protocol version of at least 3 to sync on this application, but found version 2. Please update your application to use a newer SDK
Just do in your terminal
npm install realm
Then
cd ios
pod install
Be careful of breaking changes.
If needed, uninstall your application on your emulator/simulator then
npx react-native run-ios
or
npx react-native run-android
So for Android I guess you have to update your Realm packages as well...

include.gradle file being generated is causing problems

When building a project I get the following error:
Flavor 'nativescript-telerik-ui' has unknown dimension 'nativescript-telerik-ui'.
It happens only when using the pro version through the #progress registry. Doesn't happen with the local .tgz pro version.
I noticed the error has to do with the include.gradle file it generates. I read the following article: https://docs.nativescript.org/plugins/plugins#includegradle-specification
It says that when the plugin doesn't have the include.gradle, at build time gradle creates a default one with default elements. When I saw the include.gradle it generated for the plugin it seems to have generated a default one like so:
android {
productFlavors {
"nativescript-telerik-ui" {
dimension "nativescript-telerik-ui"
}
}
}
The include.gradle generated for the local .tgz version of the plugin is like this:
android {
productFlavors {
"F6" {
dimension "nativescripttelerikuipro"
}
}
}
I replaced the default include.gradle with the latter and it got past the error. You can recreate the problem by following these steps:
create a new hello world app
use the command npm login --registry=https://registry.npm.telerik.com/ --scope=#progress to log in if you're a paying customer.
use the command npm install --save #progress/nativescript-telerik-ui-pro to install the plugin
use tns run android
Is there anything I can do to solve this problem? Really need help on this.
My name is Vladimir and I am part of the nativescript-telerik-ui-pro team. Thank you for logging this issue in our feedback portal. We are going to review it as soon as possible and update you regarding its status, but from what I currently see there is some incorrect "parameters" passed to the 'pro' version of the plugin that are going to be resolved very fast.
We apologize for any inconvenience that this is causing.

Xamarin.UITests Android Device Not Detected or Not Working

I can't run Xamarin.UITests on any Android simulator/emulator. Any suggestions? I get the following errors when I try:
Google Emulator:
SetUp: System.Exception: Unable to run on a physical device without activation.
The full version is available for Xamarin Test Cloud customers, for more information contact sales#xamarin.com
If you are already a Xamarin Test Cloud customer, you can provide your api in one of the following ways:
* Adding it ConfigureApp using the ApiKey method
* Setting the XTC_API_KEY environment variable
* Adding the following attribute to your Properties/AssemblyInfo.cs file: [assembly: Xamarin.UITest.TestCloudApiKey(YOUR_API_KEY)]
* Place an xtc_api-key file containing your api key in an upstream directory from the test assembly
Xamarin Android Player:
SetUp: System.Exception: No devices connected
GenyMotion:
SetUp : System.Exception : Failed to execute: /users/erikandersen/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb devices - exit code: 1
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error:
adb server is out of date. Killing…
After updated GenyMotion to 2.3.1, I now get the following error:
SetUp: System.Exception: App Installation failed with output: 12050 KB/s (11199602 bytes in 0.907s)
pkg: /data/local/tmp/final-xxxxxx.apk
Failure [INSTALL_FAILED_CPU_ABI_INCOMPATIBLE]
NUnit Code
AndroidApp _app;
public string PathToAPK { get; set; }
[TestFixtureSetUp]
public void BeforeAll ()
{
var path = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
var info = new FileInfo(path);
var directory = info.Directory.Parent.Parent.Parent.FullName;
PathToAPK = Path.Combine(directory, "Android", "bin", "Debug", "Demo.Android.apk");
}
[SetUp]
public void BeforeEach ()
{
_app = ConfigureApp.Android.ApkFile (PathToAPK).StartApp ();
}
[Test]
public void TestInvalidEmail ()
{
_app.EnterText (c => c.Class ("UITextField"), "");
}
TestInvalidEmail() is never called because NUnit fails on
_app = ConfigureApp.Android.ApkFile (PathToAPK).StartApp ();
Background:
I'm using Xamarin.UITests for an iOS/Android application I'm developing and we're having issues with the Android side of things. iOS works fine. I've written each test twice, once in C# and once in Ruby using calabash, in order to isolate the issue. Calabash works fine, but any C# NUnit Test Project fails to connect to any emulator I try launching.
What I've tried:
Making sure an emulator is already running before I run the tests
Making sure only 1 emulator is running
Restarting the adb server
Trying multiple types of emulators (i.e. Xamarin Android Player, Gennymotion, and the Google Emulator)
So, after several hours of working on this, this fixed it:
Upgrade GennyMotion to 2.3.1
Delete my old GenyMotion Simulator (Nexus 4) and create a new one
Add support for all ABIs in my Android Build settings
Android Project > Options > Android Build > Advanced Tab > Supported ABIs > Check "armeabi, armeabi-v7a, x86" > OK
Generate a new .apk file via the terminal (while inside the Android project directory)
/usr/bin/xbuild /t:Package /p:Configuration=Release .csproj
Resigned the .apk via calabash-android
calabash-android resign ./bin/Release/.apk
In Xamarin Studio, set my Startup Project as the my UITest project
Launch GenyMotion simulator
Ran the tests under the Debug configuration with only the GenyMotion simulator active
And it worked! I still can't run UI tests with the Google Emulator or the Xamarin Android Player. Funny thing is, I also can't debug my Android project using GenyMotion. It's only good for UITests. SO here's my current setup:
Xamarin Android Player - Normal debug
GenyMotion - UITests
I had the same problem and fixed by setting the ApiKey when setting ConfigureApp.
[SetUp]
public void SetUp()
{
_app = ConfigureApp.iOS.AppBundle(PathToIPA).ApiKey("YOUR_API_KEY_HERE").StartApp();
}
As in here. Just put your ApiKey there.
Note: I didn't have this problem with Xamarin Android Player. I didn't have this problem with AVD running an Android 5.0 emulator. I only had this problem with AVD running an Android 4.0.3 emulator.

Appium can't find 'appPackage' parameter

I'm trying to run simple RSpec test on real Android device using Appium. My config is:
apk = {
device: :android,
app_path: *path_to_apk*,
app_package: *app_package*,
app_activity: '.Start'
}
Then I'm starting driver by:
Appium::Driver.new(apk).start_driver
Script fails with error:
Selenium::WebDriver::Error::WebDriverError: Parameter 'appActivity' is
required for launching application
I tried to debug by steps and found out, that in Selenium::WebDriver::Remote::Http::Default inside request method script sends post request with path: "/wd/hub/session" and body: {"desiredCapabilities":{"platform":"OS X 10.9","platformName":"android","name":"Ruby Console iOS Appium","device-orientation":"portrait","app":*path_to_apk*}}. The response is HTTPInternalServerError object with body:
"{ "status": 33, "value": {
"message": "A new session could not be created. (Original error: Parameter 'appActivity' is required for launching application)",
"origValue": "Parameter 'appActivity' is required for launching application" }, "sessionId": null }"
I can't understand what's the problem and find any solutions in google. Maybe value of 'app_package' parameter is wrong? So my second question is how can I get it?
P.S. Before all, appium was run in terminal by command appium & and started successfully
How to get app package?
Answer: Open 'Dev Tools' in emulator/device, then go to package browser then select your application , there you will get the app package along with available activities.
What is the problem with your code:
Ensure to include these stuffs:
platformName: 'Android',
appActivity: '.activity_name',
appPackage: 'package_name'

Categories

Resources