Backstory:
This is important because I'm trying to compare how it differs from executing tests from command line with: ./gradlew :testDebug
You see, when running the test package from Android Studio my tests run correctly, but running with command line above gradle throws an exception.
The root of the problem is that when run on command line gradle cannot find resource file for dependent Module B. Line that throws exception: setParametersFromResource(context, R.raw.coursera_mobile_android, VALUE_NAMESPACE);
gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.
Open cmd in the project directory and execute gradlew. bat assemble . Actually i had a project already just want to import it for that proceed with by the following File-->Open-->build. gradle(from that existing project).
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
If you're creating the original value using resValue then you don't have to read it back from resources. You already have the value in your build. gradle script. Just assign it to a local variable and use it to create a resource for each variant.
I knew before you can read the gradle executions via the Gradle Console, but didn't realize you can execute that bundle of commands via command line.
Example from Gradle console:
Execute [:<module_name>:assembleDebug, :<module_name>:assembleDebugUnitTest]
to:
./gradlew [:<module_name>:assembleDebug, :<module_name>:assembleDebugUnitTest]
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