Tags down


Robolectric 4.0.2 test are not running in gradle 3.2.1 with NoSuchMethodError: setUseLegacyResources(Z)V

By : Martyne Lespaux
Date : October 14 2020, 08:10 PM
fixed the issue. Will look into that further Solved by this answer on my issue
That Gradle config is picking up different versions of robolectric dependencies
code :
robolectricVersion = '4.0.2'
robolectric : "org.robolectric:robolectric:${robolectricVersion}",
shadowsSupport : "org.robolectric:shadows-support-v4:${robolectricVersion}",
shadowsMultidex: "org.robolectric:shadows-multidex:${robolectricVersion}",

Share : facebook icon twitter icon

Is there a way to execute a single Robolectric 2.3 test (using Gradle)?

By : ainaa
Date : March 29 2020, 07:55 AM
should help you out I'm running them in Android Studio and from there you can execute one test, one test case, all tests in the package: How to run unit tests with Android Studio
About command line you can take a look on this plugin: https://github.com/JCAndKSolutions/android-unit-test

Robolectric-Gradle plugin running single test

By : flasza
Date : March 29 2020, 07:55 AM
Any of those help Made the same mistake myself. Thats the format for jcandksolutions plug-in (at least that's what I was using). -Dtest.single= is not supported by RoboE-Gradle plugin.
Use --tests mechanism. This can be either --tests or wildcard with --tests *.*Test

Running Robolectric test from gradle gives OutOfMemoryError. Fine from AndroidStudio

By : Denmas Yadie
Date : March 29 2020, 07:55 AM
To fix the issue you can do Eugen was correct. Once I updated to JDK 8 my out of memory errors went away.
With that fixed, I was left with the 1 issue that everyone faces with running Robolectric from a library: it doesn't find the resources. Many people suggest copying all the files over. For me it was as simple as setting the src directory in gradle
code :
android {
    sourceSets {
    // a work around for robolectric
    // https://github.com/robolectric/robolectric/issues/1796
    test.java.srcDirs += '../App/build/generated/source/r/debug'

Android gradle test with robolectric

By : lee sin
Date : March 29 2020, 07:55 AM
I hope this helps you . I'm using AndroidStudio and build with gradle. , Try using the latest snapshot of the plugin.

Test resources folder with Robolectric and Gradle

By : afonso silva
Date : March 29 2020, 07:55 AM
like below fixes the issue I guess your issue is related to an open issue at google. https://code.google.com/p/android/issues/detail?id=136013
There exist also a workaround here an unmodified copy from post #10
Related Posts Related Posts :
  • How to unit test retrofit call?
  • Retrieving Uid's from Firebase Database
  • How to automatically close rewarded video ad in onRewarded method
  • Check if two Location Instances are the same value?
  • How to get the base alphabet of a foreign word and sort them accordingly like in device local contact?
  • http2 doesn't seem to be working with OkHttp3 and retrofit2
  • Failed to resolve: com.google.android:flexbox:1.1.0
  • How to fix Xiaomi specific RemoteServiceException with notification icon?
  • Placing text in the center of a CircularProgressIndicator
  • Calculator that accepts floating point values
  • Bitrise error Could not find com.google.gms:google-services:3.2.1
  • Check if Input is empty doesnt work Kotlin
  • Could not find method compile() for arguments [com.google.gms:google-services:4.0.0]
  • View AGPS setting in Android
  • Am I doing dependency injection in activity code correctly?
  • React Native Gradle ImagePicker wont build
  • React Native changes to code have no affect on emulator app?
  • Get the TextView value of the gridview while clicking on an element
  • How to launch an intent for a third party app?
  • Going crazy trying to change android theme on Xamarin.Forms
  • Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are
  • How can I capture variables inside of Context
  • React Native : Could not find com.android.tools.build:gradle:2.2.3
  • Google Login/Signin on Yandex Android extension
  • Retrofit generates wrong GET request parameters from Map<String : Any>
  • Flutter app crashing when opening first time with ClassNotFoundException on Android
  • Android LinearLayout programmatically one column left, one column float right
  • Kotlin - convert UTC to local time
  • Android'd ForegroundDispatch for NFC
  • How to use Shared Preferences in class to set all activities?
  • Synchronous Volley request locks up
  • How do I inherit a function from another class into an activity in kotlin?
  • BottomAppBar Navigation Icon with Badge
  • Change content_main XML in Basic Navigation Drawer Template
  • HERE SDK Android: PositioningManager not working with NETWORK_PROVIDER in 3.8 or 3.9
  • No response after putting in Header in request
  • Where are default shared preferences written to?
  • how to show a part of next image in daimajia slider?
  • AlertDialog Builder inside holder.itemView.setOnClickListener onBindViewHolder
  • Flutter Grid view is not scrolling
  • How to access view in addTextChangedListener?
  • How do I link multiple activities in android navigation editor?
  • Failed to resolve: com.google.android.exoplayer:extension-mediasession:2.8.4
  • ViewPager + Picasso + multiple images from URL String array
  • how do I open another fragment after selecting the image in recycler view?
  • Send data from fragment to another fragment
  • Custom TitleView with Description and Preview Image Android TV (FireTV)
  • Gradle project sync failed. basic functionality (e.g. editing debugging) will not work properly
  • how to retrieve firebase storage images in release mode?
  • Android Studio: Could not find matches as no versions of com.android.tools.build:gradle are available
  • Getting a JSON Left side Value
  • Is it possible to use of Mobile data while transferring file via Wi-Fi Direct?
  • Build Error: Could not find any version that matches com.android.tools.build:transform-api:1.5.+
  • How to be notified of another app's crash?
  • Could not find com.android.tools.build:gradle:2.2.3
  • Recyclerview scroll to empty Edit Text
  • How to set applicationID using Android.mk
  • Firebase: How to implement "take action only when another device is online"?
  • Can not find attribute app:useSimpleSummaryProvider
  • Relation between buffers and glVertexAttribPointer
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org