-3

I recently reinstalled Windows 10, and of course, reinstalled Android Studio.

And My Android Studio project had no problem when I was working with Android Studio 2.x. However, after setting up Android Studio 3.0, I noticed that something went wrong. Android studio was throwing some errors about AndroidManifest.xml. Like:

Error:(33) error: unknown element <uses-permission> found.
Error:(35) error: unknown element <uses-feature> found.
Error:(33) unknown element <uses-permission> found.
Error:(35) unknown element <uses-feature> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

When I looked at AndroidManifest.xml(Automatically genrated one),

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="blokky.youckma"
android:versionCode="1"
android:versionName="1.0" >

In here, "http://schemas.android.com/apk/res/android" text was red, and it says:

Resource registered by this uri is not reconized(Settings | Languages & Frameworks | Schemas and DTDs

I googled for this problem but I couldn't fix the problem.

https://stackoverflow.com/a/16911264

And this didn't helped me too. I can't even see the message "Android framework is detected in the project Configure" at all. When I look at event log,

2017-11-06
AM 11:09    Gradle sync started

AM 11:10    Project setup started

AM 11:11    Gradle sync finished in 1m 50s 58ms

AM 11:11    Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]

AM 11:11    Gradle build finished with 8 error(s) in 14s 236ms

These are all I can see.

And here is my full AndroidManifest.xml. I didn't touched this after installing Android Studio 3.0.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="blokky.youckma">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity" android:screenOrientation="userLandscape">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-permission android:name="android.permission.WAKE_LOCK" />
        <uses-feature android:glEsVersion="0x00020000" android:required="true" />
    </application>

</manifest>

Anyone knows what's wrong? Or the only way to fix this problem is recreating the project?

EDIT: Here is full error list:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
C:\Users\BLOKKY\Documents\YouckMa\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(33) error: unknown element <uses-permission> found.
Error:(35) error: unknown element <uses-feature> found.
Error:(33) unknown element <uses-permission> found.
Error:(35) unknown element <uses-feature> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 11s
Information:8 errors
Information:0 warnings
Information:See complete output in console
Gippeumi
  • 251
  • 2
  • 18
  • *Anyone knows what's wrong?* yes, i know - you have problem with reading ... what is written in "" documentation? what is a parent node? – Selvin Nov 06 '17 at 02:42
  • @Selvin Thanks, that was a problem. For whatever reason, AndroidManifest.xml editing screen didn't told me that was a problem until now. Now those errors are gone. – Gippeumi Nov 06 '17 at 02:53

1 Answers1

1

Change your AndroidManifest.xml file code like below.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="blokky.youckma">
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity" android:screenOrientation="userLandscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

<uses-permission & <uses-feature is always declare before the <application tag.

HassanUsman
  • 1,787
  • 1
  • 20
  • 38