charlotteg
charlotteg

Reputation: 169

Error while fetching http://schemas.android.com/apk/res/android

Ok so I was going through a tutorial online, then when i tried to change my build.gradle file to compileSdkVersion 21 instead of 23 everything lost the plot and now all my previous projects etc are all showing errors.

In the AndroidManifest.xml the 2 http lines and all the android: are all red and the the activity opening tag has a red squiggly line under it also. I have zero idea what i have done wrong! Almost like internet has gone? Just a noob so i have no idea please help!

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:android="http://schemas.android.com/tools"
          package="com.site.project" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

    </application>

</manifest>

Upvotes: 7

Views: 35223

Answers (5)

jj kk
jj kk

Reputation: 1

Search for the AndroidManifest.xml file(s). on the project ParentPath. if there are multiple, keep one and delete the others.(usually find many other)

Upvotes: 0

musterdo
musterdo

Reputation: 11

I think you have two AndroidManifest.xml files to change it. Just rename the debug AndroidManifest.xml and that solution works for me.

Upvotes: 1

Đốc.tc
Đốc.tc

Reputation: 923

you need download jdk here "https://www.oracle.com/technetwork/java/javase/downloads/index.html" then go to File > Project Structure > here you config path jdk default C:\Program Files\Java\jdk-11.0.2 . Hope this works for you

Upvotes: 1

shivench
shivench

Reputation: 54

This answer extends @adelphus'.

A new app\build\intermediates\manifests\full\debug\AndroidManifest.xml would have listed these errors. Close and reopen the AndroidManifest.xml file from the project pane under app > manifests.

Hope this works for you.

Upvotes: 2

adelphus
adelphus

Reputation: 10316

You have duplicate schema definitions for the xmlns:android namespace in your manifest file - only one schema per namespace is allowed and I suspect the compiler is getting confused by the duplicate entry.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:android="http://schemas.android.com/tools"
          package="com.site.project" >

should be:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.site.project" >

The namespace schema definitions are important - they are used to define attribute prefixes. Because your duplicate entry is invalidating the android namespace, all attributes prefixed with android: will be wrong - this is why all the android: attributes have an error (red line) displayed.

Alternatively, just remove the tools namespace completely if you're not using any attributes with the tools: prefix in your manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.site.project" >

Upvotes: 1

Related Questions