lgdroid57
lgdroid57

Reputation: 699

Android - The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly

Is anyone getting this "xmlns" namespace issue (see below)? I cannot build my work project anymore.

Note: Issue seems similar to Android Gradle merged Values.xml uses wrong namespace, but I couldn't find an unused namespace. I ran an inspect, but no unused namespaces were found.

Upvotes: 11

Views: 4084

Answers (3)

0xAliHn
0xAliHn

Reputation: 19240

You need to remove all xmlns:android="http://schemas.android.com/apk/res/android" from your main\res\values\style.xml file style tag. Your style.xml file should be like this: (make sure no xmlns field in your style tag)

<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="AppBaseTheme" parent="android:Theme.Light">
    </style>
    <style name="AppTheme" parent="AppBaseTheme">
    </style>

    <style name="RadioButton" parent="@android:style/Widget.CompoundButton">
        <item name="android:button">@null</item>
        <item name="android:padding">5dp</item>
    </style>

    <style name="EditText" parent="@android:style/Widget.EditText">
        <item name="android:textSize">15sp</item>
    </style>
</resources>

Upvotes: 1

Tash Pemhiwa
Tash Pemhiwa

Reputation: 7685

I was able to clear this error by 'editing' my build.gradle fine (delete a space, etc) and THEN cleaning my build. Without first editing the gradle build file, Android Studio was not picking up the changes.

Upvotes: 0

Michael Cheah
Michael Cheah

Reputation: 286

In my case deleting the com_crashlytics_export_strings.xml file fixed this error.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<!--
  This file is automatically generated by Crashlytics to uniquely 
  identify individual builds of your Android application.

  Do NOT modify, delete, or commit to source control!
-->
<string xmlns:ns0="http://schemas.android.com/tools" name="com.crashlytics.android.build_id" ns0:ignore="UnusedResources,TypographyDashes" translatable="false">xxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</string>
</resources>

Upvotes: 27

Related Questions