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

How to display properly sized image from user gallery?
Parsing Nested JSON using gson
BlueTooth read service w/ CodenameOne
Android app stuck on black screen
How do I change the function that the button has to a different one?
How to control behavior of setScrollPosition in appwidget listview
Save text on external google drive android studio
Center align multi line html text to textview
Implementing an update to android app outside play store [closed]
MIT App inventor application error
Error:(45, 13) Failed to resolve: me.wangyuwei:LoadingiVew:1.0.5
Titanium Samsung Galaxy S7 close window shows white screen
Android: ListPreference title attribute in xml should contain a string concatenated with the selected value
print service without wifi connection is not working
Display specific markers based on spinner
Android MockWebServer dispatcher problems

Categories

HOME
android
windows
localization
scikit-learn
delphi-7
deep-learning
merge
jax-rs
3d
gradient
cublas
scripting
maxscript
vsm
appcelerator-studio
windows-ce
filechannel
http-post
keytool
template-engine
pyramid
gmm
database-connection
sar
rubymotion
gulp-watch
pagespeed
constexpr
custom-controls
powershell-ise
spring-security4
gnat-gps
carriage-return
indy10
openerp-7
google-knowledge-graph
xcode7.3
flatmap
connection-pool
google-data-api
visa
plaintext
movilizer
openal
clarifai
dotnet-httpclient
rserve
aquamacs
tinkerpop
wpas
modelsim
java-6
excel-dna
dt
flyout
cmp
py2neo
vcloud-director-rest-api
gets
preprocessor
qtplugin
myspace
file-uri
mongodb-php
nikeplus-api
udpclient
swizzling
kango-framework
cda
hadoop-partitioning
sklearn-pandas
ellucian-scribe
beanstalk
custom-errors
assertion
themoviedb-api
google-books
iced-coffeescript
lasso
uncompress
rdflib
skspritenode
gamekit
variadic-templates
execve
deform
tweenlite
create.js
authlogic
conditionaltagsupport
isqlquery
oocss
unit-of-work
epiceditor
pclzip
superscrollorama
insert-id
chart-director
tree-balancing
redis-py
garbage
ikimagebrowserview
promotion-code
jqote
undefined-index
vs-android
tui
fail-fast-fail-early
todos
product-management

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App