-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resources$NotFoundException Resource is not a Drawable #449
Comments
Have you tried rebuilding your app with Espresso ? I encountered the same problem last week while discovering Appium. Do not forget to uninstall your app from the device before starting a new Appium session, just in case. I'm sorry I can't help more if this is a real issue. Reference here |
I can run my Espresso tests outside of Appium without issue. Is that what you mean by "rebuilding your app with Espresso"? |
im facing the same issue, have you found the solution @copolii ? |
Also have the same issue. Is there any solution? @copolii @ganjarpanji |
@sfkir not yet, do you have any idea with this issue @saikrishna321 @KazuCocoa ? |
here my specific error :
|
As #460 (comment) , I thought this kind of error was dependencies inside product code and espresso driver. I have no exact answer for it, unfortunately, since mostly it depends on dependencies in production code and espresso... |
But crash doesn't happen when I run Espresso tests. This only happen when I run my Appium tests with Espresso driver. |
I forgot which issues or somewhere, but I saw/heard a similar situation. (Maybe similar case, but sorry if it is wrong. I could not remember clear for now...) Vanilla espresso could build and launch while Appium espresso failed. |
currently my app already migrate with androidX, how about you @sfkir ? now im testing with older version app |
@ganjarpanji Yes, our app already migrated with AndroidX. |
AndroidX was just an example. I googled the word and found some similar issues. https://stackoverflow.com/questions/55862661/resourcesnotfoundexception-thrown-after-updating-gradle-plugin-to-3-4-0 |
Hi everyone, I think this problem when android try load windowBackground from theme |
when we are set windowBackground=@null into theme, this work corrected. I think error create R file or problem with styable |
hi @dkonurov can you verify if |
I've managed to fix it for our app by changing this driver:
Overall I think Android build process is too complex to have espresso server setup as simple as it is now. I'd be much more confident in the server if it had most android dependencies |
@TarCV You are always welcome to create a PR if you have good improvement proposals |
I'm not sure I'll have time to implement general fix, but count me in for testing such fix. |
Oh my god, big thanks for your answer! Finally, I can run it on androidx! 💯 |
awesome, thanks guys i managed to make it work now. 😆
Totally agree with this, we should make the build of it more generic somehow. |
@TarCV @aldochristiaan @ganjarpanji Hi guys i am also facing the same issue with our app since it migrated to androidx. I tried the above fix but it does not seem to be working for me. Please let me if i did anything wrong. Below is the change i did in build.gradle
|
in device logs i can see this exception as well. Not sure if it has to do something with the error.
|
@poojachoudhary13 i think there is already a PR to fix #497 you could check on that. |
@ganjarpanji i checked the PR too. Only one thing is changed in the above PR. |
@poojachoudhary13 you should replace default appium espresso server APK inside Don't use capability |
@aldochristiaan Thankyou, it worked for me too. I did not notice earlier that there was a cached apk as well which i had to delete. |
@aldochristiaan @TarCV - After a new app release i am getting this exception now while starting espresso server session. Not sure if this is due to the changes i did for fix the above issue.
|
Were you using release version for automation ?
I'm sure this will solve your problem .. Maybe we should add documentation for this too @mykola-mokhnach |
Hi all, was having the Drawable issue, was able to avoiding it but now getting the "lifecycleEventObserver" exception @aldochristiaan the
|
Also some resource related failures may be because Espresso driver server APK doesn't have some application dependencies. I'm implementing the related feature as part of #496 |
Also getting error related to no static method as @uterator and @poojachoudhary13 mentioned
I get that error after rebuilding espresso server with the changes listed by @TarCV with the proguard rules applied. The error is present when testing my app in both Debug and Release mode. I'm using the latest Any other thoughts on ways to proceed here? EDIT: If it helps it looks like it could be due to 3rd party dependencies? Looking at the stack trace for me
I see that reactnativenavigation starts the NavigationActivity, could it be possible that their code is not compatible with the sdk version we're using or something of that sort? This is all new to me, so trying to grasp few things here still. |
I found a fix for the lifecycle errors. In the def lifecycle_version = "2.1.0"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" |
Great, that really solves the lifecycle errors |
Here are the dependencies which work, no Drawable or Lifecycle errors are stopping the execution anymore
|
@uterator would you mind creating a PR? |
@aldochristiaan @hunzai @uterator @dchhetri Am facing the same problem of 'Caused by: android.content.res.Resources$NotFoundException: Resource xxxx (7f070059) is not a Drawable (color or path): TypedValue{t=0x5/d=0x3e01 a=2 r=0x7f070059}. and also having this error I followed the solutions that is mentioned above but not able to locate the build.gradle file under this path '/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/espresso-server/app' . Do we need to create a build.gradle file. Am not sure of what should be done. Am new to use the espresso driver appium. Any help is really appreciated. |
@aldochristiaan First I got the 'Resources$NotFoundException Resource is not a Drawable error' as mentioned in the start of the thread by @copolii . Then used this apk 'debug-androidTest.apk.zip ' apk posted by @aldochristiaan. This error message Resources$NotFoundException Resource is not a Drawable error' is fixed but getting crashing on following line /Users/USER/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner INSTRUMENTATION_RESULT: shortMsg=Process crashed. INSTRUMENTATION_CODE: 0 Can you guys please help me @hunzai @aldochristiaan @copolii . Sorry for asking so much. Am new to espresso. So don't have any idea. |
@aldochristiaan Does Android developer has added the espresso test dependencies in the app? |
It should be possible to fix this issue with {
"additionalAppDependencies": [
"com.google.android.material:material:1.0.0",
"androidx.lifecycle:lifecycle-extensions:2.1.0"
]
}
|
I'm getting a very similar error in my application: I had used Espresso before no problem and it was sooooo nice. UiAutomator2 has been insanely slow for some reason and I would love to use this framework again, i've tried various things from above with no luck any help is super appreciated |
Two questions @TarCV ,
|
To solve Drawable and lifecycle errors I tried the same approach which worked for Espresso driver 1.16 and it worked for Espresso driver 1.23.2 too. But I guess it can be project specific. |
Hi, i want to ask about how to use this appium with espresso driver. Do we have to add espresso dependencies in the android application? |
Hi, I'd like to share my experience with solving this issue. There were also 2 other PRs, which among other changes, also disabled transitive dependencies as previous PR. But these pulls were closed for some reason:
2 out of 3 PRs also introduced different changes in dependencies:
So, looks like we have 1 common reason, and several reasons specific for AUT. In case of our application, we required next additional changes on top of the current latest version of espresso-server/app/build.gradle (please see #610)
It was assumed by @glebplotnikovring and @TarCV that the build process of the espresso-server app could be modified. Like in #496, it could be possible to specify/override dependencies at the build phase, thus all AUT specific dependencies should never be merged into mainline. All ideas and thoughts on this topic are highly appreciated. Thanks |
As for now, I am passing this data in a file to espressoBuildConfig capability, and it works as nothing had happened.
|
Hello, I have a problem with starts appium inspector: My capabilities: Logs from appium: |
Appium v1.12.0
I'm not very familiar with Appium, this is my first crack at this.
I get the following exception when I try to start an Appium session with espresso. The crash is happening in the
onCreate
method of all my activities (I've tried starting with different activities) viaandroidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
.This crash does not happen when I change the driver to
UiAutomator2
, run the app on its own, or run my Espresso test suite. The crash only occurs when I run through Appium via the Espresso driver.My config JSON:
Exception Stack trace:
Trying with Appium 1.13.0 gives me a different error:
[debug] [MJSONWP] Encountered internal error running command: Error: java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=13136, uid=13136 not allowed because package io.appium.espressoserver.test does not have a signature matching the target com.redacted.debug
The text was updated successfully, but these errors were encountered: