Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 仅对仪表apk应用proguard_Android_Android Testing_Android Espresso - Fatal编程技术网

Android 仅对仪表apk应用proguard

Android 仅对仪表apk应用proguard,android,android-testing,android-espresso,Android,Android Testing,Android Espresso,嗨,我正在用浓缩咖啡进行仪器测试 现在启用proguard for debug build检查一切正常时,我添加了各种与测试相关的依赖项 我收到与仪表apk相关的proguard警告。 有谁能指导我如何添加proguard规则,Android Studio将使用这些规则生成我的插装apk 下面是stacktrace Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced clas

嗨,我正在用浓缩咖啡进行仪器测试

现在启用proguard for debug build检查一切正常时,我添加了各种与测试相关的依赖项

我收到与仪表apk相关的proguard警告。

有谁能指导我如何添加proguard规则,Android Studio将使用这些规则生成我的插装apk

下面是stacktrace

Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.client.HttpClient
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.client.HttpClient
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.impl.conn.PoolingClientConnectionManager
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.impl.conn.PoolingClientConnectionManager
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.X509HostnameVerifier
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.SSLSocketFactory
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.scheme.SchemeRegistry
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.impl.conn.PoolingClientConnectionManager
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.SSLSocketFactory
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.scheme.SchemeRegistry
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.SSLSocketFactory
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.scheme.SchemeRegistry
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.X509HostnameVerifier
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.SSLSocketFactory
Warning: com.github.tomakehurst.wiremock.http.HttpClientFactory: can't find referenced class com.belladati.httpclientandroidlib.conn.ssl.X509HostnameVerifier
Warning: com.github.tomakehurst.wiremock.http.HttpHeaders: can't find referenced class com.fasterxml.jackson.databind.annotation.JsonSerialize
Warning: com.github.tomakehurst.wiremock.http.HttpHeaders: can't find referenced class com.fasterxml.jackson.databind.annotation.JsonDeserialize
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonDeserializer
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonDeserializer
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonProcessingException
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.DeserializationContext
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.DeserializationContext
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.DeserializationContext
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.core.JsonParser
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.DeserializationContext
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer: can't find referenced class com.fasterxml.jackson.databind.JsonDeserializer
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$1: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$2: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$2: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$2: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$2: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer$2: can't find referenced class com.fasterxml.jackson.databind.JsonNode
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.JsonSerializer
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.JsonSerializer
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonProcessingException
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.SerializerProvider
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.SerializerProvider
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.SerializerProvider
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.SerializerProvider
Warning: com.github.tomakehurst.wiremock.http.HttpHeadersJsonSerializer: can't find referenced class com.fasterxml.jackson.databind.JsonSerializer
Warning: com.github.tomakehurst.wiremock.http.ProxyResponseRenderer: can't find referenced class com.belladati.httpclientandroidlib.client.HttpClient
Warning: com.github.tomakehurst.wiremock.http.ProxyResponseRenderer: can't find referenced class com.belladati.httpclientandroidlib.HttpResponse
Warning: com.github.tomakehurst.wiremock.http.ProxyResponseRenderer: can't find referenced class com.belladati.httpclientandroidlib.StatusLine
Warning: com.github.tomakehurst.wiremock.http.ProxyResponseRenderer: can't find referenced class com.belladati.httpclientandroidlib.HttpResponse

         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
下面是build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.aaa.bb"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"


    }
    buildTypes {
        debug{
            testCoverageEnabled true
            minifyEnabled true
            testProguardFile "test-proguard-rules.pro"
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled true
            testProguardFile('test-proguard-rules.pro')
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }

    lintOptions{
        disable 'InvalidPackage'
    }
    packagingOptions {
        exclude 'LICENSE.txt'
        exclude 'LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
        exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    def appDependencies = rootProject.ext.appDependencies;
    def testDependencies = rootProject.ext.testDependencies

    compile appDependencies.appCompact
    compile appDependencies.perCent
    compile appDependencies.design
    compile appDependencies.recyclerView
    compile appDependencies.butterKnife
    compile appDependencies.eventBus
    compile appDependencies.rxJava
    compile appDependencies.materialDialog
    compile appDependencies.rxAndroid
    compile appDependencies.dagger
    compile (appDependencies.materialDialog.toString()){
        transitive true
    }
    compile appDependencies.retofit
    compile appDependencies.retrofitGsonConverter
    compile appDependencies.retrofitRxJavaAdapter
    provided appDependencies.daggerCompiler
    provided appDependencies.javaxAnnotation

    /////////////////  our projects ////////////
    compile project(':pushnotification')
    ////////////////////////////////////////////


    //////////// TDD //////////////////////////
    testCompile testDependencies.jUnit
    testCompile testDependencies.roboelectric
    testCompile (testDependencies.assertJ.toString()){
        exclude group:'com.android.support'
    }

    androidTestCompile testDependencies.espresso
    androidTestCompile testDependencies.espressoIntent
    androidTestCompile testDependencies.runner
    androidTestCompile testDependencies.runnerRules
    androidTestCompile testDependencies.mockito
    androidTestCompile testDependencies.supportAnnotations
    androidTestApt testDependencies.daggerCompiler

    androidTestCompile files(testDependencies.wireMockJar)
    androidTestCompile testDependencies.wmHttpClientAndroid
    androidTestCompile testDependencies.wmLogging
    androidTestCompile testDependencies.wmGuava
    androidTestCompile testDependencies.wmJetty
    androidTestCompile testDependencies.wmJackSonCore

    androidTestCompile (testDependencies.wmJsonAssert) {
        exclude group: 'org.json', module: 'json'
        exclude group: 'commons-collections', module: 'commons-collections'
    }
    androidTestCompile testDependencies.wmXmlUnit
    ///////////////////////////////////////////////////////////////////


}
下面是test-proguard-rule.pro

-dontobfuscate
-dontwarn

什么是proguard警告?添加了堆栈跟踪。要创建插装apk,只需渐变。在Android Studio Gradle面板(右侧)中选择,然后
:app->build->assembleAndroidTest
请发布您的构建文件