Jenkins aws device farm pugin unable to find artifact / apk - android

I am using jenkins to do the build for a Android project which works fine but uploading the apk to device farm results in a IOException as the plugin can't find the file.
Build Log
[AWSDeviceFarm] Using Project 'Android SDK2'
[AWSDeviceFarm] Using DevicePool 'Test Devices'
[AWSDeviceFarm] Using App '/AndroidSDK/PlayerSDK/build/outputs/apk/androidTest/debug/PlayerSDK-debug-androidTest.apk'
[AWSDeviceFarm] Unable to find artifact java.io.IOException: Expecting Ant GLOB pattern, but saw '/AndroidSDK/PlayerSDK/build/outputs/apk/androidTest/debug/PlayerSDK-debug-androidTest.apk'. See http://ant.apache.org/manual/Types/fileset.html for syntax
Build step 'Run Tests on AWS Device Farm' marked build as failure
Finished: FAILURE
I have tried changing application path to
**/build/outputs/apk/androidTest/debug/PlayerSDK-debug-androidTest.apk
and
**/PlayerSDK-debug-androidTest.apk
but this leads to "No artificats found at this location" error. Any ideas?

Related

Unable to determine the workspace. You may be able to correct this by running

I try to build apk file in my tfs server. When i run build, after 5 minutes tfs server tell me that my apk file was build and status ok, byt in folder not apk file , in folder only my logs.
Run build_APK.bat
F:\Android\projects\Mrdoc\TeamBuildTypes\mobile_v3R\\build_APK.bat "\\tfb\storage\mobile v3r_1.7\"
Get last version in TFS Server...
Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.
Enviroment initializing...
The system cannot find the path specified.
Assembling...
Deploing path:"\\tfbd\storage\mobile v3r_1.7\"
The command "F:\Android\projects\Mrdoc\TeamBuildTypes\EOSmobile_v3R\\build_APK.bat "\\tfb\storage\mobile v3r_1.7\"" exited with code 1.
I ran the command 'tf workspaces /collection:TeamProjectCollectionUrl'
and I saw all users but it did not help me.
Overall Build Process
Get the Build
Update Build Number
Run On Agent Default Agent - test1
Get the Build Directory
If Not String.IsNullOrEmpty(ConfigurationFolderPath)
Run TfsBuild for Configuration Folder
Getting sources
Labeling sources
Generating list of changesets and updating work items
Выполнена сборка $/Doc/TeamBuildTypes/mobile_v3R/TFSBuild.proj для целевых объектов CompileConfiguration.
MSBuild Log File
If CompilationStatus = Unknown
Set CompilationStatus to Succeeded
If TestStatus = Unknown
Set TestStatus to Succeeded
First if your build service was registered with network service. Give a try with changing it to a windows user with enough build permission.
Moreover, please make sure you have a workspace mapping for your build computer and for the windows account under which build agent runs.
Take a look at this similar issue: Team Build, fixing the "Unable to determine the workspace" error

Where's JUnit test results located in Gradle build for Android?

I'm trying doing to do a continuous integration via jenkins.
I'm at the publishing tests results part now and having a bit of struggle.
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
hudson.AbortException: No test report files were found. Configuration error?
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:116)
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:92)
at hudson.FilePath.act(FilePath.java:981)
at hudson.FilePath.act(FilePath.java:959)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:89)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:121)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:138)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1784)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
It says that it cannot find any test results.
Here's path that I've set in the jenkins:
I just followed what's stated here Gradle Plugin User Guide
All test results are stored as XML files under
build/androidTest-results
So what's the real path? Thanks!
Test reports path was changed since that article was written. Now you will find you reports in <module-name>/build/outputs/reports/androidTests directory. By default Android Studio will create module with name app. In that case path to your reports will be app/build/outputs/reports/androidTests.

Gradle Error for Android Studio

I'm trying out Android Studio on OS X and am running into a mysterious error message. I went through the Google guide to building a simple UI, but when I finished writing the XML file and hit Run in the IDE, I get the following message ("Test2" is the name of the project):
Gradle: Execution failed for task ':Test2:validateDebugSigning'.
> Could not find matching constructor for: org.gradle.tooling.BuildException(java.lang.String)
I have never developed an android app before, so I don't know how common this is. I did a search for this error and found no one encountering the same problem.
I tried the solution from Abhan and I get a new error message:
Error: org.jetbrains.plugins.gradle.settings.GradleSettings cannot be cast to org.jetbrains.plugins.gradle.settings.GradleSettings
It warns you that android plug-in task validateDebugSigning cannot access the debug key. Check your accessibility to the debug.keystore.
On linux or OS X, the default location is ~/.android. On windows, it's in C:\Documents and Settings\.android\ or C:\Users\.android.

Jenkins unable to locate files on my computer

when ever I try to build my android project on jenkins it fails by saying :
Started by user anonymous
Building in workspace /home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2
[mysteryshopper_version2] $ ant -Dlabel=trial1-9 clean debug
Buildfile: /home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2/build.xml
BUILD FAILED
/home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2/build.xml:90: Cannot find /home/tanzeelrana/android-sdk-linux/tools/ant/build.xml imported from /home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2/build.xml
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
on line 90 in my build.xml file I have a tag with the following in it :
import file="/home/tanzeelrana/android-sdk-linux/tools/ant/build.xml"
does anyone know why it is unable to locate this file ? the file exist at the exact path ....
Jenkins usually runs with its own user (jenkins),
so it is probably an issue of permissions.
Try printing the current user from within your Jenkins job.
EDIT:
See here about running Jenkins as a daemon -
it also shows how to set it to run as a different user than 'jenkins':
Installing Jenkins as a Unix daemon

Jenkins-CI SCP Plugin cannot find files to upload

I have Jenkins-CI compiling an Android app I'm working on. Compiles it great but it will not upload the release apk via SCP. I have set the source to bin/* and it gives me the following error. Does anyone have a suggestion on what I have configured wrong? I've had it working in the past, but I forgot to get the config before I re-installed Fedora on the machine.
[SCP] Connecting to smccloud.com
ERROR: Failed to upload files
2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1741)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1758)
at com.jcraft.jsch.ChannelSftp.stat(ChannelSftp.java:1715)
at be.certipost.hudson.plugin.SCPSite.upload(SCPSite.java:188)
at be.certipost.hudson.plugin.SCPRepositoryPublisher.perform(SCPRepositoryPublisher.java:218)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:657)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:635)
at hudson.model.Build$RunnerImpl.post2(Build.java:161)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604)
at hudson.model.Run.run(Run.java:1400)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
Build step 'Publish artifacts to SCP Repository' changed build result to UNSTABLE
I encountered this error when I was trying to copy to a directory that didn't exist on the target machine. Create the directory(s) on the target first and this should go away and the copy work.
On the target machine you are seeing something like:
No such file or directory
when you try to navigate to the non-existent directory.
If the plugin isn't working for you can use the shell script with expect, as a post build step, to do it for you.

Categories

Resources