trevjonez / composer-gradle-plugin

Gradle task type and plugin for interacting with https://github.com/gojuno/composer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run composer on all modules that have androidTests

Rolf-Smit opened this issue · comments

I'm working on a project that has more than 60 different Gradle Android modules. Some of those have androidTests as well as the app module. Currently we are only running the androidTests in the app module, but we would like to also use composer for all other modules.

When I run ./gradlew testDebugComposer I was expecting composer to run for every module, except that it seems to exit with an error:

Exception in thread "main" java.lang.IllegalStateException: Process [script, -F, /Users/*/project/libraryModule/90180196301875.output, /Users/*/Library/Android/sdk/build-tools/30.0.0/aapt, dump, badging, /Users/*/project/libraryModule/build/outputs/apk/androidTest/debug/libraryModule-debug-androidTest.apk] exited with non-zero code 15 Script started on Tue Aug  4 12:19:19 2020
command: /Users/*/Library/Android/sdk/build-tools/30.0.0/aapt dump badging /Users/*/project/libraryModule/build/outputs/apk/androidTest/debug/libraryModule-debug-androidTest.apk
script: /Users/*/Library/Android/sdk/build-tools/30.0.0/aapt: No such file or directory

Script done on Tue Aug  4 12:19:19 2020

	at com.gojuno.commander.os.ProcessesKt$process$1.subscribe(Processes.kt:119)
	at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
	at io.reactivex.Observable.subscribe(Observable.java:12267)
	at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
	at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I'm not sure how to fix this issue or what exactly is going wrong, is this supposed to work?

Just to confirm, this is from a project that is using com.android.application, com.android.library, or com.android.test? the dynamic-feature support can't handle more than one feature project and I've not been able to spend the time to figure out the correct way to aggregate the list of apk's yet. (issue #63)

So composer internally will use AAPT to try and read the test package name from the test APK as well as the test-runner arg from the apk manifest if it wasn't provided in the arg list. but it looks like aapt is missing in your build tools installation.

I've seen a handful of issues with either avdmanager or the emulator being overly critical about folder layout in an SDK install. So you might check to see if build-tools is fully installed or if it was just stubbed to appease an assert in one of those tools?

Might be worth double checking permissions on the files as well? Fresh install of 30.0.1 on osx for me:
image

Or you could try reinstalling?
sdkmanager --install "build-tools;30.0.1"

Side note: Now that composer is a part of this project, I'd actually like to stop relying on aapt for this, since both should be extractable from the AGP configuration api.