Uri is not registered for placement in test resources

I am new to Android testing and I am trying to test a custom view in an android library and I am using Android Studio.

I found here: Android: how to check user view? which I should use ActivityUnitTestCase and layout. I placed my xml layout inside projectname / library / src / androidTest / res / layout, and my test activity knows my R id layout because of this: Setting up res srcDirs for androidTest sourceSet . My problems are in the layout content.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <eu.custom.customView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>
</RelativeLayout>

In my case, " http://schemas.android.com/apk/res/android " is displayed in red with the error "URI is not registered", and the IDE doe does not recognize my custom view if I add it to this xml.

Is there a way to work with this layout without putting it in production code?

thank

+4
source share
1 answer

Well, in my Eclipse IDE your code looks correct (no red lines), can I suggest you download the ADT-Bundle again or use Android Studio? I think your IDE is corrupt or something in your settings is incorrect. Also check if you downloaded the updated SDK build tools.

0
source

All Articles