How to generate html report with gradle 1.12? - android

Anyone knows how to generate test report for gradle 1.12?
I'm using gradle 1.12. My Test extends ActivityInstrumentationTestCase2. using Espresso test framework. My test run but doesn't generate html report.
Here's my build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url 'http://JRAF.org/static/maven/2' }
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
...
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(file('version.properties')))
defaultConfig {
applicationId 'com.android.apps'
minSdkVersion 9
targetSdkVersion 20
versionName versionProps['name']
versionCode versionProps['code'].toInteger()
testApplicationId 'my.test'
testInstrumentationRunner 'com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner'
}
android {
useOldManifestMerger true
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
abortOnError false
}
productFlavors {
}
}
I run my test using shell script
Here's my shell script:
# Clean and Build the project
gradle clean build
# Install apk to device
gradle installDebug installDebugTest
# Run specific test
/Applications/Android\ Studio.app/sdk/platform-tools/adb shell am instrument -e class my.test.RunTestSuite -w my.test/com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner
The result in command prompt:
...
BUILD SUCCESSFUL
Total time: 55.003 secs
my.test.TestActionBar:.
Test results for GoogleInstrumentationTestRunner$BridgeTestRunner=.
Time: 32.519
OK (1 test)
If fail
Test results for GoogleInstrumentationTestRunner$BridgeTestRunner=.E
Time: 29.595
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1

See Gradle userguide by navigating to Example 23.14. Creating a unit test report for subprojects
Also see this post

Related

Android project there is no output dir after gradle build success?

I am learning Gradle for Android recently. For learning impressively, i create all android application files manually.
my project dirs as below
package name : com.wonbin.gradledemo
project build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
allprojects {
repositories {
jcenter()
}
}
app module build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.wonbin.gradledemo"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "adroid.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
lintOptions {
htmlReport true
htmlOutput file("lint-results.html")
}
}
dependencies {
compile fileTree(dir:'libs',include:['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',{
exclude group: 'com.android.support',module: 'support-annotations'})
compile 'com.android.support:appcompat-v7:23.4.0'
testCompile 'junit:junit:4.12'
}
./gradlew build is successful and there are 'intermediates' and 'generated'
dirs , but no outputs dir, i don't know what to do!
Thanks a lot!
You need not only to build, but to assemble it as well.
To do this you can run a gradle task
assembleDebug
Or use Build -> Build APK main menu item

Android unit testing: connectedAndroidTest does not execute my test case

I am trying to add some unit tests to my app. I am developing my app in Android Studio
This is what I did.
Added a new package
Created a class in new package which extends TestCase
Added following method to created class
#SmallTest
public void basicTest() {
assertEquals("abc", "abc");
}
Added following to defaultConfig section in build.gradle
testApplicationId "newly.added.package.name"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
Executed following command in Android Studio Terminal
gradlew.bat connectedAndroidTest
But, when I checked the generated html report, it shows that 0 tests were run.
I tried following, but none of them made a difference to the output of gradlew.bat connectedAndroidTest command.
Added an incorrect package name to testApplicationId in build.gradle.
Disconnected device
Why doesn't my test case get executed? What have I missed?
Following is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "my.package.name"
minSdkVersion 12
targetSdkVersion 18
testApplicationId "my.package.name.tests"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile project(':my_sub_module1')
compile project(':my_sub_module2')
compile 'com.android.support:support-v4:21.0.2'
compile files('libs/my_dependent_lib-1-7-4.jar')
compile 'com.google.code.gson:gson:2.3'
}
repositories {
mavenCentral()
}
You should use the following testInstrumentationRunner:
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Also, click Build Variants on the left side of Android Studio, and select
Android Instrumentation Tests
in the dropdown.

FAILURE: Gradle Build failed with an exception

I have included the new Android library module (dmxmediapicker) project into my currently working library project (Myapplication), which I have used as a library for my Android module (NormalProject). But after including the Library module, gradle failed to build, and also it showed the The input line is too long exception. How do I fix this?
Exception
:Myapplication:preDexDevDebug
:Myapplication:dexDevDebug
The input line is too long.
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Myapplication:dexDevDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\INO37\AppData\Local\Android\sdk\build-tools\19.1.0\dx.bat --dex --no-optimize --output D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\dex\dev\debug D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\classes\dev\debug D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-787d89f55747f839e6edf29f29d38d35f17b3a30.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\support-annotations-20.0.0-240aab9bab6593b41d1b3b540c6045232da1fa77.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\cwac-sacklist-1.0.1-dda711d827778efe1c760bdb948ba1a39acfd793.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\converter-jackson-1.5.1-f30ef27d5fcffccb406fd4debc4dd598df411298.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\annotations-12.0-b5b365c95aae0dd9d05b7150051dc81ac4a66207.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-6332debc38975f95cd72b9fb79d4ef959550aafc.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\android-viewbadger-6be9349f633a8c52e4e84a7473b884c75df7646f.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\cwac-merge-1.0.4-1690f7eaf3148874821653f2b44eb043d6dfac24.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-9663eb2427df2a79f7656f8997524dff6aba8ed3.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\robospice-retrofit-1.4.12-7add9ad83809cfec85130664e3f0f8d8f4db3812.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\jackson-annotations-2.3.1-12e826dc80ebd316473afbc007d5d62fb9ca931f.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\apktool-lib-1.4.4-3-8ee8794680007892ea0aa71ccf4f62f403b090c0.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-80d40aaa7e9898a9b07a24730ef98c587235ea59.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\slf4j-api-1.7.6-b9d683e8b480a08f5408a9b52ef0e5c371ce1989.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\eventbus-2.2.1-b9680385a60ef0d57864db42aa7b408c98a39042.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-40c97f3059c5dbf257683f47006900cf32413fef.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\bolts-android-1.1.2-441bafc5a672d6d05e9a4e94445d14df854efa44.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\parent-app-template\build\intermediates\pre-dexed\dev\debug\robospice-cache-1.4.12-5cfde6eacf18940c1fb4721fafddd2699e39e6c8.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\parent-app-template\build\intermediates\pre-dexed\dev\debug\vixlet-core-536faacbfbdc9433aee1f435fdb78fcd538268f9.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\parent-app-template\build\intermediates\pre-dexed\dev\debug\library-2.6.0-6a4e906d7bcdb8616d57e8a005349bc659a4824e.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\robospice-1.4.12-003969d6ebfe39f32a146d77d99400c5484dc106.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\retrofit-1.5.1-10a09668d9b0d5fe5ca0227e21727fd008a69d4c.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\internal_impl-20.0.0-6592f598898c5eae47b6699221e16f83ae130dd0.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\library-2.4.0-99f385b1bc28f43ad47d88dcaaee564612041d59.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\commons-io-1.3.2-c3e895cac4d0af50751028ec6b5cf91e13a11944.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\logback-android-classic-1.1.1-2-e37f9f12967b461668ea7a08aa31566dc647e9cb.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\universal-image-loader-1.9.2-30f8c46db3505acf9c16140d5124dce613db573a.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\jackson-core-2.3.1-569c0b6fff725c0772a2544b76c505956a040cb3.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\logback-android-core-1.1.1-2-ba8bc87e327fe59477b1a30abe6b447e438a32c5.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\okhttp-1.5.4-41055e1ec4b4b9e132ba9b71d7cc04e5a8a5553d.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\twitter4j-core-4.0.2-84defff66a9193544b9ef0f2c15565686a93cf7b.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-0cf819e9a2eb35706dd00dfff8f168e26bb6a9e5.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\commons-lang3-3.3.2-c4491073f0be9d854ecd8b34d316f7f2bc02ca21.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-ce1a88d8493673e442b95c84f6ac34b0b16fd5e4.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-499ae4fd3a32c9bb92892715a01ef3a35567e56c.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\classes-2b5d899cfe71f40eb1264e9826473d56e636ace6.jar D:\Jamal\Workspaces\AndroidStudioProjects\Workspace\From_GH_19_12_AND_63\Myapplication\build\intermediates\pre-dexed\dev\debug\jackson-databind-2.3.1-ad7662486febdd462bc1d048504a9658311ead09.jar
Error Code:
255
Output:
The input line is too long.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
biuld.gradle for dmxmediapicker
apply plugin: 'android-library'
android {
compileSdkVersion 20
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 12
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.android.support:appcompat-v7:20.0.0'
}
biuld.gradle for MyApplication
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 20
buildToolsVersion "19.1.0"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
minSdkVersion 12
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile project(":dmxmediapicker")
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
}
biuld.gradle for NormalProject
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "19.1.0"
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
productFlavors {
dev {
}
staging {
}
production {
}
}
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 12
targetSdkVersion 20
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.test
}
release {
debuggable false
signingConfig signingConfigs.release
}
}
}
dependencies {
compile project(':MyApplication')
}
As per ligi's comment
I have set the buildToolsVersion As 21.1.1 now the build issue have been solved.
After installing openjdk-11-jdk my problem solved
sudo apt-get install openjdk-11-jdk
NOTE: before installing jdk11 uninstall any other jdks
For example
sudo apt autopurge openjdk-19-jdk:amd64 openjdk-19-jdk-headless:amd64 openjdk-19-jre:amd64 openjdk-19-jre-headless:amd64
This will solve your problem
In Android Studio, go to Tools->SDK manager and see that your android version is downloaded or not (for whatever emulator you have chosen as your virtual device).
If not download it and play the emulator again.
This should work now!!
In my case, the files of my android folder was misconfigured as I did some changes before.
I Just created a new flutter app and copied the android folder from the new created app and pasted it to my previous flutter project and that worked.
I know this is not an appropriate way to solve the problem but at least this solution could be useful in case you need to make it quick.

Gradle Clean Build and connectedAndroidTest

I'm playing with Gradle for Android recently... It's powerful but painful at the same time.
Initially, I followed Roboletric sample project, trying to make a gradle-based Android project with Robolectric testing support. After a while, I realise Robolectric doesn't even support API 19. Thus, I remove it from my build.gradle and try to use Junit and Instrumentation tests.
I'm not familiar with either Android or Gradle or Roboletric. I only know that before I removed Robolectirc, whenever I made a build ./gradlew clean build I was able to run all the tests. But now, I have to call ./gradlew connectedAndroidTest in addition to run tests while the build command only calls check but no test is run and thus always show SUCCESSFUL
I have attached my configuration here:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
packageName "com.example"
testPackageName "com.example.tests"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
flavorDimensions "AppPackage", "AppEnvironment"
appBasic {
flavorDimension "AppPackage"
}
staging {
flavorDimension "AppEnvironment"
}
production {
flavorDimension "AppEnvironment"
}
}
sourceSets {
androidTest.setRoot('src/test')
androidTestStaging.setRoot('src/testStaging')
androidTestProduction.setRoot('src/testProduction')
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.0.0'
compile 'com.android.support:appcompat-v7:20.0.0'
}
By default the connectedAndroidTest task don't run when you run the build task.
By default the check task run when you run the build task.
All you have to do is to add an explicit dependency to run the connectedAndroidTest task when the check task run :
check.dependsOn connectedAndroidTest

Jacoco with Gradle 0.10.0: Remote object doesn't exist

UPDATE Oct 21, 2014:
The issue has been confirmed as fixed by using buildtools 21.
UPDATE SEPT 18, 2014:
The issue's status has been updated to FutureRelease.
UPDATE:
I have heard that this may not work with Dagger, and since Espresso uses Dagger, it might be causing some issues. A bug was submitted to the Gradle team.
Google recently updated their Gradle implementation to 0.10.0. One of the things they now offer is Jacoco support. To do this, they mention setting the following:
testCoverageEnabled = true
Into your build type. Now when I run my Espresso tests (using connectedCheck), I get an error right as I start to run the :connectedAndroidTest task that states:
Tests on HTC One - 4.2.2 - API 17 - 1080x1920 - 4.2.2 failed: Instrumentation run failed due to 'java.lang.VerifyError'
01:38:31 E/Device: Error during Sync: Remote object doesn't exist!
null
java.io.IOException: com.android.ddmlib.SyncException: Remote object doesn't exist!
at com.android.builder.testing.ConnectedDevice.pullFile(ConnectedDevice.java:114)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:158)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:42)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.ddmlib.SyncException: Remote object doesn't exist!
at com.android.ddmlib.SyncService.pullFile(SyncService.java:314)
at com.android.ddmlib.Device.pullFile(Device.java:849)
at com.android.builder.testing.ConnectedDevice.pullFile(ConnectedDevice.java:107)
... 8 more
:connectedAndroidTest FAILED
Here are the parts I have changed in the build.gradle file:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
...
}
...
}
android {
buildTypes {
debug {
testCoverageEnabled = true
...
}
....
}
...
}
Is there any other piece of build.gradle file that I need to update in order to get Jacoco working?
The error mentions that a "remote object" doesn't exist. Usually I attribute this to the emulator being out of sync and a restart would fix it. But I've tried that and it isn't worked either. Any ideas what the error is trying to tell me?
Try This One...
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.0'
}
}
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1" // Must Require
defaultConfig {
applicationId "com.packagename" <Change it>
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
lintOptions {
abortOnError false
}
buildTypes {
debug {
testCoverageEnabled true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
jacoco {
toolVersion = "0.7.1.201405082137"
}

Categories

Resources