I want to make in Android Studio my test module to be dependent of application module, but can not achieve this, have mistake
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 provided project(':app') in dependency tag (it is done by Android studio automatically)
How would I resolve this? I need dependency on src, res folders of my main app and need to know R file
To use your new Android library's code in another app or library module within the same project, add a project-level dependency: Navigate to File > Project Structure > Dependencies. Select the Module in which you'll use the library. In the Declared Dependencies tab, click and select Module Dependency in the dropdown.
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
Dynamic feature modules allow you to separate certain features and resources from the base module of your app and include them in your app bundle. Through Dynamic Delivery, users can later download and install those components on demand after they've already installed the base APK of your app.
Select the source directory of the Module you want to import and click Finish. Open Project Structure Dialog (You can open the PSD by selecting File > Project Structure) and from the left panel click on Dependencies. Select the module from the Module(Middle) section In which you want to add module dependency.
This is now possible using com.android.test
plugin. Works fine for Java and resources stuff.
An example by Google can be found here.
Basically you create a separate module for testing and define which module and flavor should be tested. I've just checked it and it has some issues with working with the IDE, but runs fine with gradle command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With