简体   繁体   中英

Manifest Errors After Update to Android Studio 3.0 (AAPT2)

After I updated the Android Studio to 3.0 I'm having the following error with some third-party libraries:

Error:(30) error: unknown element < android.widget.TextClock > found. Error:(140) error: unknown element < com.dlazaro66.qrcodereaderview.QRCodeReaderView > found.

I have tried to check for any new syntax for this implementation and I couldn't find any at https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2

Here's my manifest.xml:

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.devtt.ttb.encantt" android:installLocation="auto" android:versionCode="32" android:versionName="2.31" > <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="24" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="true" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:required="true" /> <uses-permission android:name="android.permission.CAMERA" android:required="true" /> <uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <application android:allowBackup="true" android:debuggable="true" android:hardwareAccelerated="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true" android:testOnly="true" android:theme="@style/AppTheme" > <activity android:name="com.devtt.ttb.encantt.LoginActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.clientSummaryActivity" android:label="Resumo do Cliente" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.daySummaryActivity" android:label="EncanT.T." > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.editClientActivity" android:label="Editar Cliente" android:windowSoftInputMode="adjustResize|stateAlwaysHidden" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.saleSummaryActivity" android:label="Detalhe da Venda" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.saleCommentActivity" android:label="Detalhe da Venda" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.searchActivity" android:label="Buscar Clientes" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.optionsActivity" android:label="EncanT.T" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.verifyQrActivity" android:label="EncanT.T" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.viewCostumer2Activity" android:label="EncanT.T" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.searchCommentActivity" android:label="EncanT.T" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.devtt.ttb.encantt.preSearchActivity" android:label="EncanT.T" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> <com.dlazaro66.qrcodereaderview.QRCodeReaderView android:id="@+id/qrdecoderview" android:layout_width="match_parent" android:layout_height="match_parent" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <activity android:name="com.devtt.ttb.encantt.DecoderActivity" /> <provider android:name="com.android.tools.ir.server.InstantRunContentProvider" android:authorities="com.devtt.ttb.encantt.com.android.tools.ir.server.InstantRunContentProvider" android:multiprocess="true" /> </application> </manifest> 

And app gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.devtt.ttb.encantt"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 32
        versionName '2.31'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    api 'com.android.support:appcompat-v7:24.2.1'
    api 'com.android.support:design:24.2.1'
    testCompile 'junit:junit:4.12'
    api 'com.koushikdutta.ion:ion:2.+'
    api 'com.yalantis:ucrop:2.2.0'
    api 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.2'
    api 'joda-time:joda-time:2.9.4'
}

It literally states in the error message that you posted, what the error is.

With name and everything.

<com.dlazaro66.qrcodereaderview.QRCodeReaderView
            android:id="@+id/qrdecoderview"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

That's a view, for layout XML files. It shouldn't be in the manifest.

Pedro, You seem new to android

<com.dlazaro66.qrcodereaderview.QRCodeReaderView
            android:id="@+id/qrdecoderview"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

This code never comes to manifest.

The manifest file provides essential information about your app to the Android system, which the system must have before it can run any of the app's code.

Your error simply saying this, so you can resolve this.

unknown element < com.dlazaro66.qrcodereaderview.QRCodeReaderView > found.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM