browserstack / browserstack-gradle-plugin

Gradle plugin for uploading app and running tests on BrowserStack
16 stars 20 forks source link

Mac Apple M1 Support #62

Open ahna92 opened 2 years ago

ahna92 commented 2 years ago

Issue

OS : MAC MacBook Pro Chip: Apple M1 Pro CLI : 3.1.0

When trying to use this command ./gradlew app:executeDebugTestsOnBrowserstack always facing this error

> Task :app:executeAlphaDebugTestsOnBrowserstack FAILED
Most recent DebugApp apk: null
Most recent TestApp apk: null

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:executeAlphaDebugTestsOnBrowserstack'.
> java.lang.Exception: unable to find DebugApp apk

but when checking build/outputs/apk/debug and build/outputs/apk/androidTest/debug i can see the apks

also in the pipeline (linux) command working fine

bs-ashwanipathak commented 2 years ago

In your tests is the .apk file defined as bs://UPLOAD_APP_HASH_ID?

ahna92 commented 2 years ago

hi @bs-ashwanipathak

i'm using this script file

{
  "devices": ["Samsung Galaxy S9 Plus-9.0"],
  "project": "My project",
  "shards": {
    "numberOfShards": 2
  }
}

and these gradle configs

browserStackConfig {
    username = browserStackUserName
    accessKey = browserStackAccessKey
    configFilePath = "browserStackConfig.json"
}
kanikarakheja commented 1 year ago

I am getting the similar issue as well. Running below command in Android Studio terminal. Running ./gradlew clean executeDemoDevDebugTestsOnBrowserstack gives error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:executeDemoDevDebugTestsOnBrowserstack'.
> java.io.IOException: unable to find DebugApp apk

Most recent DebugApp apk: null

Is there any workaround for this ?

bhumikababbar commented 1 year ago

Hi Kanika,

Currently BrowserStack only takes apk whose name is ending with -android.apk Can you try updating the apk name like this and check?

I also found this open thread with more details - https://github.com/browserstack/browserstack-gradle-plugin/issues/40

kanikarakheja commented 1 year ago

This #40 helped. I commented out app renaming and it worked. Thanks @bhumikababbar