Status Update
Comments
aa...@gmail.com <aa...@gmail.com> #2
can you share your android studio version
sh...@gmail.com <sh...@gmail.com> #3
Is this happening with Studio 3.0?
ca...@gmail.com <ca...@gmail.com> #4
Note: This worked for me on Windows 7 Pro 32-bit (with Android Studio 2.3.3). Seems like an issue with adt-branding module (which should contain the "/idea/AndroidStudioApplicationInfo.xml" resource).
mi...@corp.badoo.com <mi...@corp.badoo.com> #5
Hi, also happened on Mac Book Pro 15 retina mi-2015
MacOs Sierra 10.12.6
Android Studio 2.3.3
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
MacOs Sierra 10.12.6
Android Studio 2.3.3
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
ss...@gmail.com <ss...@gmail.com> #6
Thank you for this feedback. Your feedback helps make sure Android development tools are great! Given your issues has been resolved I am closing this issue.
ch...@gmail.com <ch...@gmail.com> #7
Anyone got a work around for this? Like ignore the generated files, or navigating the fileTree and changing file names from $$ to $?
ch...@gmail.com <ch...@gmail.com> #8
I have a workaround for Robolectric + Jacoco + Dagger (http://chrisjenx.com/gradle-robolectric-jacoco-dagger/ ). Yet to try with AndroidTests.
ca...@gmail.com <ca...@gmail.com> #9
I finally had a chance to circle back to this.... Thanks for your post Chris. It works great. I made a slight enhancement to rename the files back after generating the report. This prevents needing to do a full clean after running:
task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = false
html.enabled = true
}
classDirectories = fileTree(
dir: './build/classes/debug',
excludes: ['**/R.class',
'**/R$*.class',
'**/*$InjectAdapter.class',
'**/*$ModuleAdapter.class',
'**/*$ViewInjector*.class'
])
sourceDirectories = files(coverageSourceDirs)
executionData = files('build/jacoco/testDebug.exec')
renamedFilesMap = [:]
// Hacky fix for issue:https://code.google.com/p/android/issues/detail?id=69174 .
// Rename files with '$$' before generating report, and then rename back after
doFirst {
new File('build/classes/debug').eachFileRecurse { file ->
if (file.name.contains('$$')) {
oldPath = file.path
newPath = oldPath.replace('$$', '$')
file.renameTo(newPath)
renamedFilesMap[newPath] = oldPath
}
}
}
doLast {
renamedFilesMap.each() {
newPath, oldPath ->
new File(newPath).renameTo(oldPath)
}
}
}
task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = false
html.enabled = true
}
classDirectories = fileTree(
dir: './build/classes/debug',
excludes: ['**/R.class',
'**/R$*.class',
'**/*$InjectAdapter.class',
'**/*$ModuleAdapter.class',
'**/*$ViewInjector*.class'
])
sourceDirectories = files(coverageSourceDirs)
executionData = files('build/jacoco/testDebug.exec')
renamedFilesMap = [:]
// Hacky fix for issue:
// Rename files with '$$' before generating report, and then rename back after
doFirst {
new File('build/classes/debug').eachFileRecurse { file ->
if (file.name.contains('$$')) {
oldPath = file.path
newPath = oldPath.replace('$$', '$')
file.renameTo(newPath)
renamedFilesMap[newPath] = oldPath
}
}
}
doLast {
renamedFilesMap.each() {
newPath, oldPath ->
new File(newPath).renameTo(oldPath)
}
}
}
aa...@gmail.com <aa...@gmail.com> #10
Has anyone gotten this work with tests run on device, with for example espresso?
ma...@gmail.com <ma...@gmail.com> #11
The problem seems to be mainly to do with code coverage functionality not working on Java 1.6 version or above. If you keep the Java version down to 1.5, jacoco code coverage work fine even when using espresso, dagger etc.
xa...@android.com <xa...@android.com> #12
We've identified this as a bug in dx which does not properly handle bytecode generated by jacoco's offline instrumentation.
xa...@android.com <xa...@android.com> #16
[Comment deleted]
ma...@gmail.com <ma...@gmail.com> #18
Can some one throw light as to which version of gradle addresses this issue and what the step are to get it to work correctly? Thanks
xa...@android.com <xa...@android.com> #19
The fix is not in Gradle, it is in dx which will be updated with the Android L SDK.
we...@gmail.com <we...@gmail.com> #20
Shouldn't this be available in a new version of the Build tools, and not the L Platform SDK? Or is the new Build Tools somehow tied to L?
Here's the path to dx in my environment:
android-sdk-macosx/build-tools/20/lib/dx.jar
Here's the path to dx in my environment:
android-sdk-macosx/build-tools/20/lib/dx.jar
si...@gmail.com <si...@gmail.com> #21
[Comment deleted]
re...@netmoms.de <re...@netmoms.de> #22
Will this been released tomorrow together with Android Lollipop?
m....@gmail.com <m....@gmail.com> #23
ss...@gmail.com <ss...@gmail.com> #24
I can confirm that the issue has been fixed for us with buildtools 21.
va...@gmail.com <va...@gmail.com> #25
Also fixed for us.
Description
while developing Android applications (Emulator, DDMS, Eclipse support,
ant scripts...). Use the Developer templates for issues with Android
itself.
Please describe the problem in detail, with the following information (if
applicable)
Host OS: Ubuntu 14.04
SDK tools version (available in the "About" section of the 'android' tool
UI): 22.6.3
Android Studio version: 0.5.7
Platform targeted by your project: 19
Version of the platform running in the emulator: 18
STEPS TO REPRODUCE:
0. Have project that uses Dagger and Android Gradle plugin 0.10+
1. Add 'testCoverageEnabled true' to testing build type
2. Run ./gradlew cC
EXPECTED RESULTS:
Tests should run and get a coverage report in build/reports/coverage.
OBSERVED RESULTS:
Test crashes with
Tests on Nexus_7_4.3(AVD) - 4.3 failed: Instrumentation run failed due to 'java.lang.VerifyError'
03:35:46 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:744)
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
ADDITIONAL INFORMATION:
Attached sample project.