android


Using Ant to build project and run JUnit Test Android app but Ant Junit Test fails


I have a simple Android project that I created. I also created Junit cases for the project. I have my Android app and TestCases in the same project. My structure is like the following:
-AndroidApp
-src
-SampleActivity
-tests
-SampleActivityTest
I have changed the Order and export options and made sure JUnit is at the top.
I have added
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.sample.app"
android:label="UnitTest" />
<uses-library android:name="android.test.runner" />
Running Android JUnit Test works fine in Eclipse, but when I try to build & Junit Test the app with Ant the project/app builds but the test fails.
Here's the error:
test-run:
[junit] Test com.mark.prototype.test.SampleAndroidAppTest FAILED
compile-and-test:
BUILD SUCCESSFUL
Total time: 3 seconds
Can't figure out why it's failing in Ant.
Best way is create auto ant build via Export then select Ant BuildFiles and then modify it according to your requirement.

Related Links

Cannot retrieve error message from server in Error Listener of Volley in Android
How to detect android device rotation parallel to the ground?
JSONObject.put(string,string) not working
invalid param in LinerLayout:layout.weight? [closed]
Picasso onBitmapLoaded returns bitmap but not being drawn on canvas
I got the error when I am trying to delete items of Recycler View
How to transmit an Eddystone Beacon with Url using Altbeacon Library for Android
how can I change colour of list item background after it has been uploaded to an ERP server?
ListView with dynamic number of EditTexts containning rows
BURP and Fiddler don't detect WebSockets on Android/iOS?
Share via whatsapp doesn't add image if frequent contact is selected on Android
How to handle same pattern in uri matcher for content provider?
Android Volley gives error regarding session
Retrofit 2 does not parse response in case error
Image file path Issues
Android Studio inspections are different on different machines

Categories

HOME
service-worker
embedded
httparty
eclipse
pascal
battery
sh
rom
scripting
cq5
vert.x
performancepoint
fabric.io
categorical-data
ipmitool
coin3d
mvc-mini-profiler
jersey-1.0
sencha-touch
named-entity-recognition
pchart
epsilon
froala
appirater
mat
8051
spotipy
custom-controls
python-2.6
kudu
openwhisk
carriage-return
nested-lists
slacktextviewcontroller
servicestack-text
sim-card
cin
urlsession
setup.py
lpsolve
opencmis
spring-integration-sftp
datamaps
magic-draw
backbone-collections
filehandle
gpg-signature
mathcad
rsa-archer-grc
reachability
autosar
webjars
pacemaker
resourcemanager
nikeplus-api
jquery-jscrollpane
sklearn-pandas
ikiwiki
thread-sleep
jaunt-api
vhosts
dynatree
grgit
iokit
jdi
intel-c++
sony-lifelog-api
atoi
viola-jones
airbrake
cwrsync
nsurlsessiondatatask
mraid
cakephp-2.7
android-vibration
gii
mobility
personalization
rcaller
matrix-inverse
eclipse-kepler
printdialog
flex++
poker
pclzip
mysql-error-2013
fb.ui
wimax
adobe-media-server
ikimagebrowserview
denied
promotion-code
lr
entitydatasource
cgbitmapcontextcreate
inline-formset
globals
echo3
filesystemobject
mathematical-notation
xpsdocument

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App