Appium Espresso VectorDrawableCompat
See original GitHub issueI am trying to test my application, but I can´t get it working. I am looking for solution for long time but unfortunately with no success. Maybe you can solve my problem.
I will show you my config files, my test class and the log output, maybe someone will find the solution for that.
Build.gradle (the android app)
apply plugin: 'com.android.application'
android {
android {
lintOptions {
abortOnError false
}
}
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.wintermute.gmassistant"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
vectorDrawables.generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
//lombok
implementation 'org.projectlombok:lombok:1.18.10'
implementation 'com.google.android.material:material:1.0.0'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
//REST Client
implementation 'com.android.volley:volley:1.1.1'
//color picker
implementation 'com.github.skydoves:colorpickerpreference:2.0.0'
//Guava
implementation 'com.google.guava:guava:28.1-android'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Test.class
public class TestApp
{
private WebDriver driver;
public void setUp() throws MalformedURLException
{
String apkPath = new File(getClass().getClassLoader().getResource("GmAssistant.apk").getFile()).getPath();
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ESPRESSO);
capabilities.setCapability("showGradleLog", true);
capabilities.setCapability(MobileCapabilityType.APP, apkPath);
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723"), capabilities);
AppiumDriver app = new AppiumDriver(capabilities);
app.launchApp();
}
}
Log output
Proxying [POST /session] to [POST http://localhost:8300/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","showGradleLog":true,"app":"/home/wintermute/usr/dev/workspace/java/IntegrationTestsGmAssistant/build/resources/main/GmAssistant.apk","automationName":"Espresso","deviceName":"Android Emulator","platformVersion":"9"},"platformName":"android","showGradleLog":true,"app":"/home/wintermute/usr/dev/workspace/java/IntegrationTestsGmAssistant/build/resources/main/GmAssistant.apk","automationName":"Espresso","deviceName":"emulator-5554","platformVersion":"9","deviceUDID":"emulator-5554","appPackage":"com.wintermute.gmassistant","appWaitPackage":"com.wintermute.gmassistant","appActivity":"com.wintermute.gmassistant.GmAssistant","appWaitActivity":"com.wintermute.gmassistant.GmAssistant"}],"alwaysMatch":{}}}
[debug] [Espresso] [Instrumentation] [STDOUT] io.appium.espressoserver.EspressoServerRunnerTest:
[debug] [Espresso] [Instrumentation] [STDOUT] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest):
[debug] [Espresso] [Instrumentation] [STDOUT] java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:756)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:196)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:86)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:260)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:182)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:520)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
[debug] [Espresso] [Instrumentation] [STDOUT] at com.wintermute.gmassistant.GmAssistant.onCreate(GmAssistant.java:23)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.Activity.performCreate(Activity.java:7136)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.Activity.performCreate(Activity.java:7127)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:702)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.os.Handler.dispatchMessage(Handler.java:106)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.os.Looper.loop(Looper.java:193)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.main(ActivityThread.java:6669)
[debug] [Espresso] [Instrumentation] [STDOUT] at java.lang.reflect.Method.invoke(Native Method)
[debug] [Espresso] [Instrumentation] [STDOUT] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[debug] [Espresso] [Instrumentation] [STDOUT] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
[debug] [Espresso] [Instrumentation] [STDOUT]
[debug] [Espresso] [Instrumentation] [STDOUT] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest):
[debug] [Espresso] [Instrumentation] [STDOUT] java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wintermute.gmassistant/com.wintermute.gmassistant.GmAssistant}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.os.Handler.dispatchMessage(Handler.java:106)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.os.Looper.loop(Looper.java:193)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.main(ActivityThread.java:6669)
[debug] [Espresso] [Instrumentation] [STDOUT] at java.lang.reflect.Method.invoke(Native Method)
[debug] [Espresso] [Instrumentation] [STDOUT] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[debug] [Espresso] [Instrumentation] [STDOUT] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
[debug] [Espresso] [Instrumentation] [STDOUT] Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:756)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:196)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:86)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:260)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:182)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:520)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
[debug] [Espresso] [Instrumentation] [STDOUT] at com.wintermute.gmassistant.GmAssistant.onCreate(GmAssistant.java:23)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.Activity.performCreate(Activity.java:7136)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.Activity.performCreate(Activity.java:7127)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
[debug] [Espresso] [Instrumentation] [STDOUT] at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:702)
[debug] [Espresso] [Instrumentation] [STDOUT] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
[debug] [Espresso] [Instrumentation] [STDOUT] ... 11 more
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Espresso (Android) - Appium
This driver works by kicking off an Espresso run on a device, with our own automation server as part of the Espresso test...
Read more >androidx.compose.ui.test - Android Developers
AnimationCallback · AnimatedVectorDrawableCompat · SeekableAnimatedVectorDrawable · SeekableAnimatedVectorDrawable.AnimationCallback · VectorDrawableCompat.
Read more >Android Developer Fundamentals Course – Concepts
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { ... The VectorDrawableCompat class in the Android Support Library allows you ...
Read more >Classes Related with android - ProgramCreek.com
1025. android.support.test.espresso.IdlingResource. 1 commonly used methods. 1026. android.widget.AdapterView.AdapterContextMenuInfo.
Read more >awesome-java - CD2H gitForager
... Android Studio + Robolectric + Espresso + Mockito + EasyMock/PowerMock + JaCoCo ... appium/java-client - Java language binding for writing Appium Tests, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try https://github.com/appium/appium-espresso-driver/issues/449#issuecomment-568803554
https://github.com/appium/appium-espresso-driver/issues/449#issuecomment-568803554 fixed it for me