Android Studio makes my test module depend on the application module

I want to make my test module dependent on the application module in Android Studio, but I can’t achieve this, let's say

Error:Dependency AndroidApp:app:unspecified on project TestsRobotium resolves to an APK archive which is not supported as a compilation dependency. File: D:\android\MEWE\AndroidApp\app\build\apk\MeWe.apk 

In my test.gradle, I added the provided project (': app') to the dependency tag (this is done automatically by Android studio)

How can i solve this? I need a dependency on src, res folders of my main application and you need to know the R file

+8
android android-studio gradle
source share
1 answer

Now you can use the com.android.test plugin. Works well for Java and resources.

An example of Google can be found here .

Basically, you create a separate module for testing and determine which module and taste should be tested. I just checked it and it has some problems with working with the IDE, but it works fine with the gradle command line.

+1
source share

All Articles