8
In my project Android Studio is giving a rendering problem in xml, giving the following error:
Rendering Problems The following classes could not be found: - android.support.v7.internal.app.Windowdecoractionbar (Fix Build Path, Create Class) Tip: Try to build the project.
And my dependency gradle is as follows:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.mikepenz:materialdrawer:4.4.8@aar') {
transitive = true
}
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.github.shell-software:fab:1.0.5'
compile 'com.github.clans:fab:1.4.0'
compile 'me.drakeet.materialdialog:library:1.2.2'
}
My example xml that is with problem:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="br.com.ciaware.people.activities.MainActivity" >
<android.support.v7.widget.Toolbar
android:id="@+id/tb_main"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentLeft="true"
android:background="?attr/colorPrimary"
android:elevation="0dp"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<br.com.ciaware.people.extras.SlidingTabLayout
android:id="@+id/stl_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager
android:id="@+id/vp_tabs"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</RelativeLayout>
And in Messages appears these errors
Error:(11, 68) cvc-Elt.1: Cannot find the declaration of element 'Relativelayout'.
Error:(1, 56) s4s-Elt-schema-ns: The namespace of element 'x' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
Error:(1, 56) s4s-Elt-invalid: Element 'x' is not a Valid element in a schema Document.
Error:(1, 56) schema_reference.4: Failed to read schema Document 'null', because 1) could not find the Document; 2) the Document could not be read; 3) the root element of the Document is not .
And on the Gradle console it’s like this:
Executing tasks: [:app:generateDebugSources, >:app:generateDebugAndroidTestSources, :app:assembleDebug]
:Configuration on demand is an incubating Feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE :app:prepareDedroidSupportDesign2311Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE :app:prepareCompanyAndroidanimationsLibrary113Library UP-TO-DATE :app:prepareCompanyEasingLibrary101Library UP-TO-DATE :app:prepareGithubClansFab140Library UP-TO-DATE :app:prepareComGithubShellSoftwareFab105Library UP-TO-DATE :app:prepareComMelnykovFloatingactionbutton130Library UP-TO-DATE :app:prepareComMikepenzIconicsCore220Library UP-TO-DATE :app:prepareComMikepenzMaterialdrawer448Library UP-TO-DATE :app:prepareComMikepenzMaterialize028Library UP-TO-DATE :app:prepareMeDrakeetMaterialdialogLibrary122Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl UP-TO-DATE :app:processDebugAndroidTestManifest UP-TO-DATE :app:compileDebugAndroidTestRenderscript UP-TO-DATE :app:generateDebugAndroidTestBuildConfig UP-TO-DATE :app:generateDebugAndroidTestAssets UP-TO-DATE :app:mergeDebugAndroidTestAssets UP-TO-DATE :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources UP-TO-DATE :app:mergeDebugAndroidTestResources UP-TO-DATE :app:processDebugAndroidTestResources UP-TO-DATE :app:generateDebugAndroidTestSources UP-TO-DATE :app:processDebugJavaRes UP-TO-DATE :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources UP-TO-DATE :app:preDexDebug UP-TO-DATE :app:dexDebug UP-TO-DATE :app:validateDebugSigning :app:packageDebug UP-TO-DATE :app:zipalignDebug UP-TO-DATE :app:assembleDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 1,868 secs
And Gradle is like this:
apply plugin: 'com.android.application'
android { compileSdkVersion 23 buildToolsVersion '23.0.2'
defaultConfig {
applicationId "br.com.ciaware.people"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "0.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.mikepenz:materialdrawer:4.4.8@aar') {
transitive = true
}
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.github.shell-software:fab:1.0.5'
compile 'com.github.clans:fab:1.4.0'
compile 'me.drakeet.materialdialog:library:1.2.2'
}
xml style.:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="TextAppearanceFinish" parent="android:TextAppearance.Holo.Medium">
<item name="android:textColor">#fff</item>
</style>
<style name="WizardPageContainer">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:orientation">vertical</item>
</style>
<style name="WizardPageTitle">
<item name="android:id">@android:id/title</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">8dp</item>
<item name="android:layout_marginLeft">16dp</item>
<item name="android:layout_marginRight">16dp</item>
<item name="android:paddingLeft">?android:attr/listPreferredItemPaddingLeft</item>
<item name="android:textSize">36sp</item>
<item name="android:textColor">#ff0099cc</item>
<item name="android:fontFamily">sans-serif-thin</item>
</style>
<style name="WizardFormLabel">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">0dp</item>
<item name="android:textAppearance">?android:textAppearanceSmall</item>
<item name="android:textColor">@color/text_light</item>
<item name="android:textStyle">bold</item>
<item name="android:textAllCaps">true</item>
<item name="android:paddingLeft">12dp</item>
<item name="android:paddingRight">12dp</item>
</style>
How to fix this problem?
It does not render any layout or is a specific layout?
– Androiderson
@Androiderson does not render any layout, all layout xml appears this message, even the layouts of Fragments, all layouts
– Tiago Ferezin
Strange, this problem usually happens with custom views. Are there any components or include that you use in all layouts? If you create a new layout, just with a Textview for example, the problem persists?
– Androiderson
@Androiderson Yes the problem persists, thinking it is in the schemas =
xmlns:android="http://schemas.android.com/apk/res/android"
, can be sera?– Tiago Ferezin
@Androiderson put more details of the bugs
– Tiago Ferezin
On this last post, on Gradle, is version 23.1.0 appcompat-v7 while it was initially version 23.1.1. Which of the two is actually using?
– ramaral
Missed posting the Styles.xml, I need to know what the Theme that the app is using/descending.
– ramaral
@ramaral I will use the version that is easier and practical to solve the problem, the question is that in both the same error occurs, and I posted the style.xml and the theme is this "Theme.AppCompat.Light.Darkactionbar" and I’m also using several other themes.
– Tiago Ferezin
As I said in my reply if you want to use version 23.1.1 of appcompat-v7 the Theme cannot have as Parent a Theme that use Actionbar. Change
Theme.AppCompat.Light.DarkActionBar
forTheme.AppCompat.Light.NoActionBar
. See also the edition I made in the reply.– ramaral
@Tiagoferezin you still have the same problem or another?
– Jorge B.
@Worked ramaral, put as a response
– Tiago Ferezin