I am trying to write robolectric test for android app. when i am trying to read the cofig, i am getting the following error.
Caused by: java.lang.IllegalArgumentException: Got resource name bool/config_enable from id 2131427329 (0x7f0b0001), but found no resource by that name
at com.xtremelabs.robolectric.res.BoolResourceLoader.getValue(BoolResourceLoader.java:27)
at com.xtremelabs.robolectric.res.ResourceLoader.getBooleanValue(ResourceLoader.java:462)
at com.xtremelabs.robolectric.shadows.ShadowResources.getBoolean(ShadowResources.java:193)
at android.content.res.Resources.getBoolean(Resources.java)
I'd say this is https://github.com/robolectric/robolectric/issues/346. Which version of Robolectric are you using? I guess this was only ever fixed in Robolectric 2...
Related
I am trying to compile an Android Application on Android Studio and I get this error:
cvc-complex-type.2.4.a: Invalid content found from the 'base-extension' element. One of the values '{layoutlib}' is expected.
Do you know where this could come from?
I have several crash reports with the following error:
Caused by android.content.res.Resources$NotFoundException: File res/drawable/ic_keyboard_arrow_right_black_24dp.xml from drawable resource ID #0x7f07010b
at android.content.res.Resources.loadDrawable + 2096(Resources.java:2096)
What baffles me is that the app only uses PNG images. There isn't any reference to ic_keyboard_arrow_right_black_24dp.xml in the code, only to ic_keyboard_arrow_right_black_24dp.png. The error only happens in Android 4.
Does anyone have a clue about what may be causing the error?
Its likely a library loading it. Its probably trying to load the icon here: https://github.com/google/material-design-icons/blob/master/hardware/drawable-anydpi-v21/ic_keyboard_arrow_right_black_24dp.xml
If you don't want to find and fix the library, including that file in your build should fix it.
When i use Espresso to test Android UI, I followed by https://google.github.io/android-testing-support-library/docs/espresso/setup/index.html,but it cannot work for me, and when I run the test, caused this error! But the android-testing samples (espresso/BasicSample)work's ok, when i change the applicationId, it doesn't work,
also caused this error.
Follow this documentation setup android UI test with Espresso: https://google.github.io/android-testing-support-library/docs/espresso/setup/index.html
This is my problem, I typed "Runner" to "Ruuner"...enter image description here
i am using cordova for my application and using inAppBrowser plugin, before using this plugin cordova build android --release command was working properly but after adding this plugin it is showing error, if i am not giving --release it working properly means in the debug mode there is no issue.
The error which i am getting is as follow
/Users/mukesh/Documents/code/teamworkCordova/xyz/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:555: Error: Expected resource of type id [ResourceType]
actionButtonContainer.setId(1);
~
/Users/mukesh/Documents/code/teamworkCordova/xyz/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:563: Error: Expected resource of type id [ResourceType]
back.setId(2);
~
/Users/mukesh/Documents/code/teamworkCordova/xyz/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:587: Error: Expected resource of type id [ResourceType]
forward.setId(3);
~
/Users/mukesh/Documents/code/teamworkCordova/xyz/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:610: Error: Expected resource of type id [ResourceType]
edittext.setId(4);
~
/Users/mukesh/Documents/code/teamworkCordova/xyz/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:633: Error: Expected resource of type id [ResourceType]
close.setId(5);
~
/Users/mukesh/Documents/code/teamworkCordova/xyz/platforms/android/src/org/apache/cordova/inappbrowser/InAppBrowser.java:679: Error: Expected resource of type id [ResourceType]
inAppWebView.setId(6);
~
Explanation for issues of type "ResourceType":
Ensures that resource id's passed to APIs are of the right type; for
example, calling Resources.getColor(R.string.name) is wrong.
The latest release of the Inappbrowser plugin has several "errors" my Android Studio (version 1.4) complains about when building a release APK.
This on one of them.
The only way i found to get around this issue was to modify the content of
InAppBrowser.java
I changed every occurence of
object.setId(int) to
object.setId(Integer.valueOf(int))
for example: inAppWebView.setId(6) -> inAppWebView.setId(Integer.valueOf(6))
Everybody who finds a better (without manipulating the source) solution is welcome.
These "errors" are Lint errors, and it's because lint isn't sure that the number 6 is really the number 6, which is why you need to make sure that you do Integer.valueOf(int) on every object.setId.
I fixed this on the platform level so that it will no longer cause the compilation to fail, but to make lint happy, we will probably change the source so Integer.valueOf is used.
I am trying to run the sample project from customviews but facing some problems. i am not able to run any project from the site. Each time getting different type of error. I also searched in the net for the solution but failed to figure out the solution. May be i am facing a general problem for all projects and if i solve one i may be able to solve the others.
In ActionbarPullRequest library i am getting :
Description Resource Path Location Type SmoothProgressBar cannot be resolved to a type DefaultHeaderTransformer.java /library_ActionbarPulltoRefresh/src/uk/co/senab/actionbarpulltorefresh/library line
57 Java Problem
In StackBlurDemo i am getting this error :
Description Resource Path Location Type toggleButtonMode cannot be resolved or is not a field MainActivity.java /StackBlurDemo/src/com/example/stackblurdemo line 30 Java Problem