Search code examples
automated-testscontinuous-deploymentappium-androidvisual-studio-app-center

Visual studio app center: appium-test-extension-1.0.jar; error in opening zip file


I was trying to configure my test cases in VSapp center, my tests are written in appium. Followed the following steps:

Step 1# Added the JCenter repository enabled in the build.gradle in my project's root folder. build.gradle file is like following

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

Step 2# Added the androidTestCompile('com.microsoft.appcenter:appium-test-extension:1.0') in build.gradle file inside app folder

apply plugin: 'com.android.application'



android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.keya.myapplication"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        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'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    androidTestCompile('com.microsoft.appcenter:appium-test-extension:1.0')
    def appCenterSdkVersion = '1.1.0'
    compile "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
    compile "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    testCompile 'org.assertj:assertj-core:2.0.0'
    testCompile 'org.testng:testng:6.8.8'

    compile files('libs/apache-mime4j-0.6.jar')
    compile files('libs/commons-codec-1.10.jar')
    compile files('libs/commons-collections-3.2.1.jar')
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/commons-exec-1.3.jar')
    compile files('libs/commons-lang3-3.4.jar')
    compile files('libs/commons-logging-1.1.3.jar')
    compile files('libs/commons-validator-1.4.1.jar')
    compile files('libs/gson-2.3.1.jar')
    compile files('libs/guava-18.0.jar')
    compile files('libs/httpclient-4.4.1.jar')
    compile files('libs/httpcore-4.4.1.jar')
    compile files('libs/httpmime-4.4.1.jar')
    compile 'com.android.support:support-annotations:25.0.1'
    compile group: 'com.beust', name: 'jcommander', version: '1.27'




    testCompile 'info.cukes:cucumber-java:1.2.5'
    testCompile 'info.cukes:cucumber-junit:1.2.5'
    testCompile 'info.cukes:cucumber-picocontainer:1.2.2'




    compile 'com.android.support:support-v4:25.0.1'
}

apply plugin: 'maven'

task createPom {
    pom {
        withXml {
            def dependenciesNode = asNode().appendNode('dependencies')

            //Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
            configurations.testCompile.allDependencies.each {
                def dependencyNode = dependenciesNode.appendNode('dependency')
                dependencyNode.appendNode('groupId', it.group)
                dependencyNode.appendNode('artifactId', it.name)
                        dependencyNode.appendNode('version', it.version)
            }

            def profilesNode = asNode().appendNode('profiles')
            profilesNode.append(new XmlParser().parse('https://raw.githubusercontent.com/Microsoft/AppCenter-Test-Appium-Java-Extensions/master/gradleuploadprofilesnippet.xml'))
        }
    }.writeTo("pom.xml")}

within this step, everything was successful build was successful but when I was trying to import the following libs

import com.microsoft.appcenter.appium.Factory;
import com.microsoft.appcenter.appium.EnhancedAndroidDriver;

Application failed to import

Step3# I also tried to import the libs using mvn --> This step didnt work.

Application is showing Can not resolve symbol message Can any one suggest me the solution?


Solution

  • Found the solution of the problem, just simply added the jar as library in build path and its working fine