微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Robolectric 抛出 java.lang.IllegalArgumentException 没有任何消息

如何解决Robolectric 抛出 java.lang.IllegalArgumentException 没有任何消息

我正在尝试使用 Robolectric 运行测试,但我在运行时不断收到错误消息。 我只使用 Robolectric 来检索运行时上下文来运行我的测试。我正在使用 Java 8、Gradle 版本 5.6.4 和 sdk = 28 运行 Robolectric 4.3。我收到的错误是:

[Robolectric] 警告:Android SDK 10000 需要 Java 9(有 Java 8)。除非明确要求,否则不会在 SDK 10000 上运行测试。

java.lang.IllegalArgumentException
    at org.objectweb.asm.AnnotationVisitor.<init>(UnkNown Source)
    at org.objectweb.asm.AnnotationVisitor.<init>(UnkNown Source)
    at org.objectweb.asm.tree.AnnotationNode.<init>(AnnotationNode.java:77)
    at org.objectweb.asm.tree.AnnotationNode.<init>(AnnotationNode.java:63)
    at org.objectweb.asm.tree.ClassNode.visitAnnotation(ClassNode.java:208)
    at org.objectweb.asm.ClassReader.accept(UnkNown Source)
    at org.objectweb.asm.ClassReader.accept(UnkNown Source)
    at org.robolectric.internal.bytecode.ClassInstrumentor.analyzeClass(ClassInstrumentor.java:63)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.lambda$maybeInstrumentClass$1(SandBoxClassLoader.java:122)
    at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:53)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.maybeInstrumentClass(SandBoxClassLoader.java:121)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.lambda$findClass$0(SandBoxClassLoader.java:112)
    at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:53)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.findClass(SandBoxClassLoader.java:111)
    at java.lang.classLoader.loadClass(ClassLoader.java:419)
    at java.lang.classLoader.loadClass(ClassLoader.java:352)
    at org.robolectric.internal.bytecode.SandBox.bootstrappedClass(SandBox.java:41)
    at org.robolectric.internal.AndroidSandBox.<init>(AndroidSandBox.java:43)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.robolectric.util.inject.Injector.inject(Injector.java:239)
    at org.robolectric.util.inject.Injector.lambda$memoized$1(Injector.java:221)
    at org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:485)
    at org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:213)
    at org.robolectric.util.inject.Injector.getInstance(Injector.java:197)
    at org.robolectric.util.inject.Injector.access$700(Injector.java:85)
    at org.robolectric.util.inject.Injector$ScopeBuilderProvider.create(Injector.java:551)
    at org.robolectric.util.inject.Injector$ScopeBuilderProvider.lambda$get$0(Injector.java:534)
    at com.sun.proxy.$Proxy14.build(UnkNown Source)
    at org.robolectric.internal.SandBoxManager.getAndroidSandBox(SandBoxManager.java:57)
    at org.robolectric.RobolectricTestRunner.getSandBox(RobolectricTestRunner.java:267)
    at org.robolectric.RobolectricTestRunner.getSandBox(RobolectricTestRunner.java:63)
    at org.robolectric.internal.SandBoxTestRunner$2.evaluate(SandBoxTestRunner.java:215)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runchild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runchild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runchildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.robolectric.internal.SandBoxTestRunner$1.evaluate(SandBoxTestRunner.java:96)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:64)

我更新了我的 Android Studio 并编辑了配置以使用 Java 9.0.4(将命令行更新为 @argfile)但收到此错误

java.lang.IllegalArgumentException
    at org.objectweb.asm.AnnotationVisitor.<init>(UnkNown Source)
    at org.objectweb.asm.AnnotationVisitor.<init>(UnkNown Source)
    at org.objectweb.asm.tree.AnnotationNode.<init>(AnnotationNode.java:77)
    at org.objectweb.asm.tree.AnnotationNode.<init>(AnnotationNode.java:63)
    at org.objectweb.asm.tree.ClassNode.visitAnnotation(ClassNode.java:208)
    at org.objectweb.asm.ClassReader.accept(UnkNown Source)
    at org.objectweb.asm.ClassReader.accept(UnkNown Source)
    at org.robolectric.internal.bytecode.ClassInstrumentor.analyzeClass(ClassInstrumentor.java:63)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.lambda$maybeInstrumentClass$1(SandBoxClassLoader.java:122)
    at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:53)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.maybeInstrumentClass(SandBoxClassLoader.java:121)
    at org.robolectric.internal.bytecode.SandBoxClassLoader.lambda$findClass$0(SandBoxClassLoader.java:112)

如果我将 sdk 更改为 29 或 30,我会得到同样的错误。我还尝试了其他答案的建议,并在 robolectric.properties 中使用 sdk=28 创建了 app/src/test/resources,但这也不起作用。我的 targetSdkVersion=29 所以我不确定发生了什么。我有两个问题:

  1. 我的 Robolectric 配置有什么问题导致此错误
  2. 我正在使用 Robolectric 为我的测试检索上下文。是否有其他库可以代替 Robolectric 来执行此操作? 这是我的 build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

repositories {
    mavenCentral()
    maven { url 'https://dl.bintray.com/lisawray/maven' }
    maven { url 'http://guardian.github.com/maven/repo-releases' }
    // this is needed for the 'net.rdrei.android.dirchooser:library:3.2@aar' lib reference
    maven { url 'https://dl.bintray.com/tzutalin/maven' }
    google()
    mavenLocal()
    maven {
        url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
    }
    maven {
        name "vsts-maven-adal-android"
        url "https://identitydivision.pkgs.visualstudio.com/_packaging/AndroidADAL/maven/v1"
        credentials {
            username System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") : project.findProperty("vstsUsername")
            password System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCEsstOKEN") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCEsstOKEN") : project.findProperty("vstsMavenAccesstoken")
        }
    }
    jcenter()
}

buildscript {
    repositories {
        mavenCentral()
    }
}

android {
    compileSdkVersion 29
    buildToolsversion "29.0.2"  //support lib value located in project gradle

    //compileOptions.encoding = 'windows-1251'

    packagingOptions {
        //Chad King (03/14/2016): had to add this to exclude issues with license refrence from stetho dev debug tool...
        exclude 'meta-inf/DEPENDENCIES.txt'
        exclude 'meta-inf/LICENSE.txt'
        exclude 'meta-inf/NOTICE.txt'
        exclude 'meta-inf/NOTICE'
        exclude 'meta-inf/LICENSE'
        exclude 'meta-inf/DEPENDENCIES'
        exclude 'meta-inf/notice.txt'
        exclude 'meta-inf/license.txt'
        exclude 'meta-inf/dependencies.txt'
        exclude 'meta-inf/LGPL2.1'

        // CK (01/11/2019) - Temporary fix until alpha10,added this to account for runtime issues when adding the firebase in app messaging lib...
        exclude 'meta-inf/proguard/androidx-annotations.pro'

        exclude("meta-inf/jersey-module-version")
    }

    defaultConfig {
        applicationId "com.XXXX"
        minSdkVersion 19
        targetSdkVersion 29
        /**Chad King: Last update (03/06/2016) @ 3:32 PM
         * Build for adding editing soil layer percent calc manual settings...
         */
        versionCode 382
        versionName "7.5.94"    /*NOTE: the app updater looks at the version Name to determine if the one in the play store is newer,so be sure to fill in whole value (ie: 7.5.3 should be 7.5.30 [ran into issue where updater was parsing and took 7.5.24 as newer than 7.5.3])*/

        /* CK (03/22/2018) - What this options does is,it only keeps the native library of architectures mentioned in abiFilters (https://android.jlelse.eu/controlling-apk-size-when-using-native-libraries-45c6c0e5b70a) */
        ndk {
            abiFilters "armeabi-v7a",/* Most common architecture...*/
                    "x86","x86_64",/* All intel based devices */
                    "arm64-v8a"//,//"armeabi"   /* Very old architecture - Unsupported after Android 4.4 (bc we are supporting 4.0.3 we need this...)*/

            /* 64 bit ARM architecture,it can use v7 version unless you are too much concerned about performance (most flagship devices might make use of this...) */
            /* mips,mips64 - There are no devices with MIPS (unsure about emulators...) */
            /* x86_64 - shouldn't have any android devices with this AND anyways it Could just use x86 version if needed */

            /* Make note if we get reports from users who cant run plog it Could be that there devices are using one of these older architecures that we are excluding NDK support for */
        }

        multiDexEnabled true
        
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'


        // CK (05/28/2019) Testing custom document provider
        def documentsAuthorityValue = applicationId + ".documents"

        // Now we can use ${documentsAuthority} in our Manifest
        manifestPlaceholders =
                [documentsAuthority: documentsAuthorityValue]

        // Now we can use BuildConfig.DOCUMENTS_AUTHORITY in our code
        buildConfigField "String","DOCUMENTS_AUTHORITY","\"${documentsAuthorityValue}\""
    }

    sourceSets {
        release {
            assets.srcDirs = ['src/main/assets']
        }
        debug {
            assets.srcDirs = ['src/main/assetsDebug']
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            /* CK (03/22/2018) - setting this to true to remove unused resources from 3rd party libs included into plog */
            proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
            //assets.srcDirs = ['src/main/
        }
        debug {
            resValue("string","PORT_NUMBER","8085")
            //multiDexEnabled true
            //assets.srcDirs = ['src/main/assets','src/main/assetsDebug']
        }
    }

    lintOptions {
        checkReleaseBuilds false
        // Or,if you prefer,you can continue to check for errors in release builds,// but continue the build even when errors are found:
        abortOnError false
    }

    dexOptions {
        //Added to accomadate: "...java-finished-with-non-zero-exit-value-3-android-gradle" ( https://stackoverflow.com/questions/25013638/android-studio-google-jar-causing-gc-overhead-limit-exceeded-error/25013822#25013822)
        //javaMaxHeapSize "4g"
        javaMaxHeapSize "2g"
        //incremental true
    }

    //Added to allow for support for apache http for sdk 23 and higher
    useLibrary 'org.apache.http.legacy'

    testOptions {
        unitTests.returnDefaultValues = true
        unitTests.includeAndroidResources = true
    }

    compileOptions {
        // Chad King (01/04/2017) Added to allow for lambda expressions for a method to scan device directories for location external SDCard path...
        /* reference: https://developer.android.com/guide/platform/j8-jack.html */
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // Gradle automatically adds 'android.test.runner' as a dependency.
    //useLibrary 'android.test.runner'

    useLibrary 'android.test.base'
    useLibrary 'android.test.mock'

}

dependencies {

    configurations {
        all*.exclude group: 'com.android.support',module: 'support-v13'
    }

    implementation filetree(include: ['*.jar'],dir: 'libs')
    implementation project(':library')
    //implementation project(':dlib')
    //wearapp project(':wear')
    //testCompile
    testImplementation 'junit:junit:4.12'
    //testCompile
    //testImplementation 'org.json:json:20140107'
    testImplementation 'org.json:json:20171018'
    //needed to add this to parse json in unit test cases (see: https://stackoverflow.com/questions/29402155/android-unit-test-not-mocked)

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    /* CK (11/07/2018) Added for Kotlin Support*/

    // Chad King (01/26/2016): Added for support to use material style date time picker library...
    //noinspection GradleCompatible,GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.mediarouter:mediarouter:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    //implementation 'com.android.support:support-v4:25.3.0'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    // switching to v13 to replace v4
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'org.apache.commons:commons-lang3:3.7'

    // MC(10/16-2020) Update Firebase SDK
    implementation 'com.google.firebase:firebase-core:17.5.1'
    implementation 'com.google.firebase:firebase-crash:16.2.1'
    implementation 'com.google.firebase:firebase-ml-vision:18.0.2'
    implementation 'com.google.android.gms:play-services-analytics:17.0.0'
    implementation 'com.google.android.play:core:1.8.0'
    implementation 'com.google.android.play:core-ktx:1.8.1'
    implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
    implementation 'com.google.firebase:firebase-analytics:17.6.0'

    implementation 'com.squareup.okhttp3:okhttp:3.12.1'

    implementation 'me.dm7.barcodescanner:zxing:1.9.8'

    implementation 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'

    implementation 'saschpe.android:customtabs:1.1.2'

    //implementation 'com.github.ajalt.reprint:core:3.2.1@aar' // required: supports marshmallow devices

    implementation 'com.google.guava:guava:28.0-android'
    
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
   
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
    implementation 'androidx.multidex:multidex:2.0.0'
    //Chad King(01/08/2016): Added for support when viewing pdfs in app. This is to be a replacement for the custom PdfViewerActivity that the outsourced developers wrote...
    //implementation 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
    implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
    //CK (10/16/2017) - updated lib for pdf viewer,the one above is no longer maintained...
    //implementation 'com.github.barteksc:android-pdf-viewer:1.4.0'
    //Chad King(01/08/2016): Added for support for new material styled controls...
    implementation 'com.github.rey5137:material:1.2.5'
    //Chad King (01/14/2016): Added for support with applying shadow patches to layouts/controls...
    implementation 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.5'
    implementation 'com.github.markushi:android-ui:1.2'
    //Chad King (01/13/2017): Added to help aid in applying global font style to app...
    implementation 'com.norbsoft.typefacehelper:library:0.9.0'

    implementation 'com.mikepenz:iconics-core:3.0.4@aar'
    implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
    implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.4@aar'
    implementation 'com.mikepenz:fontawesome-typeface:5.0.13.0@aar'
    implementation 'com.mikepenz:octicons-typeface:3.2.0.4@aar'
    implementation 'com.mikepenz:meteocons-typeface:1.1.0.4@aar'
    implementation 'com.mikepenz:community-material-typeface:2.0.46.1@aar'
    implementation 'com.mikepenz:weather-icons-typeface:2.0.10.4@aar'
    implementation 'com.mikepenz:typeicons-typeface:2.0.7.4@aar'
    implementation 'com.mikepenz:entypo-typeface:1.0.0.4@aar'
    implementation 'com.mikepenz:devicon-typeface:2.0.0.4@aar'
    implementation 'com.mikepenz:foundation-icons-typeface:3.0.0.4@aar'
    implementation 'com.mikepenz:ionicons-typeface:2.0.1.4@aar'
    implementation 'com.mikepenz:pixeden-7-stroke-typeface:1.2.0.2@aar'
    // Chad King (01/20/2016): Added for material animation support for static views...
    implementation 'com.balysv:material-ripple:1.0.2'
    // Chad King (01/25/2016): Added for support to allow floating label feature for login dialog...
    implementation 'com.wrapp.floatlabelededittext:library:0.0.6'
    implementation 'com.wdullaer:materialdatetimepicker:3.6.1'
    // Chad King (03/02/2016): Added for db debugging on device from pc directly...
    implementation 'com.clough.android.androiddbviewer:androiddbviewer:1.0.0'
    // Chad King (03/09/2016): Added for support for dragging and reordering on children in linear layouts...
    implementation 'com.jmedeisis:draglinearlayout:1.1.0'
    // Chad King (03/14/2016): Used to debug db in chrome web dev tools...
    implementation 'com.facebook.stetho:stetho:1.5.0'
    //implementation 'com.facebook.stetho:stetho-okhttp:1.1.1' //can use this if needed for network inspections,but commented out bc it conflicts with existing okhttp lib...
    // Chad King (03/16/2016) Added for password toggle view:
    implementation 'com.xwray:passwordview:0.1'
    // Chad King (04/11/2016) Added for support for sampling dasboard cell headers that are too long...
    implementation 'me.grantland:autofittextview:0.2.+'
    // Chad King (04/13/2016) Added for customizable switch support
    implementation 'com.kyleduo.switchbutton:library:1.4.0'
    // Chad King (04/26/2016) Added for MPermissions support:
    implementation 'com.karumi:dexter:2.2.2'
    // implementation 'com.karumi:dexter:2.3.0'
    // implementation 'com.karumi:dexter:2.3.1'
    // implementation 'com.karumi:dexter:2.4.0'
    // implementation 'com.karumi:dexter:3.0.0'
    // Chad King (04/28/2016) Added for AlertDialog discrepencies for varIoUs api levels or at least until i take time to updgrade apps theme to use material style or newer...
    //implementation 'com.github.fengdai:alertdialogpro-theme-material:0.2.6'

    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

    // Chad King (05/13/2016) Added for support to do in app update check against play store version for users to update...
    implementation 'com.github.rampo.updatechecker:library:2.1.8'
    implementation 'com.github.javiersantos:AppUpdater:2.7'
    // CK (04/25/2018) Added since the rampo repo is no longer maintained and since googles updates to the playstore listings have changed...
    //implementation 'androidmads.updatehandler:updatehandler:1.0.5'

    // Chad King (07/12/2016) Added for support for capturing/sending unaccounted for app crashes...(https://github.com/Ereza/CustomActivityOnCrash)
    implementation 'cat.ereza:customactivityoncrash:1.5.0'
    // Chad King (10/05/2016) Added for additional support for app/device info...this lib has a lot of useful method calls for varIoUs scenerios to obtain generic information...will keep us from re-writing the same code,instead just call it ;)
    implementation 'com.github.nisrulz:easydeviceinfo-base:2.2.0'

    debugImplementation 'com.icapps.niddler:niddler:0.10.2'
    releaseImplementation 'com.icapps.niddler:niddler-noop:0.10.2'
  
    implementation 'com.github.daniel-stoneuk:material-about-library:1.3.0'

    // CK - testing another file picker...
    implementation 'com.gu:option:1.3'
    // this is needed for the 'net.rdrei.android.dirchooser:library:3.2@aar' lib reference
    implementation 'net.rdrei.android.dirchooser:library:3.2@aar'

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.simplify:ink:0.2.3'
    //androidTestCompile
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0',{
        exclude group: 'com.android.support',module: 'support-annotations'
    }

    // AndroidJUnitRunner and JUnit Rules
    androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test:rules:1.3.0'


    // CK (05/20/2017) - Added to account for support for parsing larger json objects for espresso golder ui testing...
    'com.googlecode.json-simple:json-simple:1.1.1'

    // CK (05/31/2017) - Added to account for Mantis 1410
    //implementation 'com.kovachcode:timePickerWithSeconds:1.0.1'

    // CK (06/06/2017) Added for better number picker support options...
    implementation 'com.shawnlin:number-picker:2.4.6'
    //https://github.com/huzenan/EasyPickerView

    //CK (06/09/2017) Added this to use the azure sdk for golder SSO
    //implementation 'com.microsoft.azure:azure-mobile-android:3.3.0'

    //CK (06/15/2017) Needed for AppAuth SSO for Clients AAD Accounts
    implementation 'net.openid:appauth:0.2.0'

    implementation 'com.github.rtoshiro.securesharedpreferences:securesharedpreferences:1.2.0'

    //compile "com.facebook.conceal:conceal:1.1.3@aar"
    implementation 'com.google.code.gson:gson:2.8.1'
    //implementation 'net.sf.flexjson:flexjson:3.2'
    //implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'

    // jsoup HTML parser library @ https://jsoup.org/
    implementation 'org.jsoup:jsoup:1.11.2'

    //db debugger in ide - CK: testing plugin but not working so commented out (06/18/2018)
    //implementation 'com.github.godwinjoseph-wisilica:debugger:1.0.1'
    //implementation 'org.java-websocket:Java-WebSocket:1.3.8'

    implementation 'com.github.yalantis:ucrop:2.2.2'
    implementation 'ja.burhanrashid52:photoeditor:0.2.1'

    implementation 'com.github.abumoallim:Android-Multi-Select-Dialog:v1.9'
    /* CK (11/01/2018) Mantis 1300 & 1326 */

    //implementation 'com.lapism:searchview:27.1.1.0.0' /* CK (11/13/2018) - added this to account for issue with using generic searchview in fragment on sp dashboard...*/

    implementation 'com.github.mrengineer13:snackbar:1.2.0'

    //implementation 'com.github.ceryle:SegmentedButton:v2.0.2'
    implementation 'com.github.ceryle:RadioRealButton:v2.1.1'


    implementation  'moe.feng:BreadcrumbsView:0.1.2' /*requires min sdk to be 19 (android 4.4 - kitkat)*/

    implementation 'com.orhanobut:logger:2.2.0'

    ////////// Architecture Update Libs //////////

    // Lifecycle Components (viewmodel,LiveData and ReactiveStreams)
    implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
    implementation "androidx.lifecycle:lifecycle-livedata:2.2.0"
    implementation "androidx.lifecycle:lifecycle-runtime:2.3.0-alpha07"

    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.fragment:fragment-ktx:1.3.5'

    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'

    implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'
    implementation 'com.google.android.material:material:1.4.0-alpha02'

    // retrofit library
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.4.0'

    // converter library for interpreting plain text response
    implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'

    // Mocking libraries
    testImplementation "com.squareup.okhttp3:mockwebserver:4.4.0"
    testImplementation "org.mockito:mockito-core:3.3.3"
    testImplementation 'org.mockito:mockito-inline:2.13.0'

    testImplementation "io.mockk:mockk:1.10.0"

    // integration testing library
    testImplementation('org.robolectric:robolectric:4.3'){
        exclude group: "com.google.guava",module: "guava"
        exclude group: "org.apache.maven"
    }
    testImplementation "org.robolectric:shadows-httpclient:4.3"
    testImplementation "org.robolectric:shadows-multidex:4.3"

    testImplementation "androidx.test:core:1.3.0"

    implementation "com.squareup.retrofit2:converter-simplexml:2.5.0"

    // Androidx Shared Prefs library
    implementation 'androidx.preference:preference:1.1.1'

    // Microsoft login libraries - MC 5/28/2021 Not using up to date libraries as they through packaging error for gradle builds
    implementation 'com.microsoft.identity.client:msal:2.0.2'
    implementation 'com.microsoft.graph:microsoft-graph:2.10.0'

    implementation 'com.auth0.android:jwtdecode:2.0.0'
}

这是我标记测试课程的方式:

@RunWith(RobolectricTestRunner::class)
@Config(manifest = Config.NONE,sdk = [28])
class AdminRepositoryTest {

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。