AAPT: error: attribute type (aka com.example.androidtrivia:type) not found

Polymath

I am using Android Studio Arctic Fox | 2020.3.1 Patch 1 of August 7, 2021.

As per the following note in https://developer.android.com/codelabs/kotlin-android-training-start-external-activity?index=..%2F..android-kotlin-fundamentals#3

Note: If you're using Android Studio 3.2 or lower, you might have to change app:type = "integer" to app:argType = "integer" in the navigation.xml file

and assuming that I am using AS higher than 3.2, I changed the app:argType="integer" to app:type="integer" in the navigation argument type.

Now the following error occurs:

AAPT: error: attribute type (aka com.example.androidtrivia:type) not found.

If I keep app:argType the project compiles and runs correctly.

Is app:type not correct to use?

project gradle:

dependencies {
    classpath "com.android.tools.build:gradle:7.0.1"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"

    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.0-alpha10"

}

module gradle

plugins {
  id 'com.android.application'
  id 'kotlin-android'
  id 'kotlin-kapt'
  id 'androidx.navigation.safeargs.kotlin'
}


dependencies {

  implementation 'androidx.core:core-ktx:1.6.0'
  implementation 'androidx.appcompat:appcompat:1.3.1'
  implementation 'com.google.android.material:material:1.4.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  testImplementation 'junit:junit:4.13.2'
  androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

  implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0-alpha10'
  implementation 'androidx.navigation:navigation-ui-ktx:2.4.0-alpha10'

  implementation "com.google.android.material:material:1.4.0"
}

error section

   <argument
        android:name="numQuestions"
        app:type="integer" />
ianhanniballake

The note:

Note: If you're using Android Studio 3.2 or lower, you might have to change app:type = "integer" to app:argType = "integer" in the navigation.xml file

Means that Android Studio 3.2 or lower is going to add app:type, which is wrong. You need to manually correct it to app:argType. On Android Studio 4.0+, it already uses the correct app:argType, which is what you should be using.

So just change the incorrect app:type to app:argType.

Este artigo é coletado da Internet.

Se houver alguma infração, entre em [email protected] Delete.

editar em
0

deixe-me dizer algumas palavras

0comentários
loginDepois de participar da revisão

Artigos relacionados

AAPT: error: attribute android:requestLegacyExternalStorage not found

Type error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. styles.xml Android AAPT

Scala "not found: type" error

Ocaml Type Error For enumerate example

mypy attribute error in Union with TextIO type

"The type or namespace name 'OfficeOpenXml' could not be found" error

Android error: AAPT: error: resource color/colorPrimary not found

Restrict attribute to property type

Error: Type 'TableMetadata' not found | FAILURE: Build failed with an exception

error: invalid initialization of non-const reference of type ‘bool&’ from an rvalue of type ‘std::vector<bool>::reference {aka std::_Bit_reference}’

Cannot assign value of type (aka 'Array<Dictionary<String, Style>>') to (aka 'Dictionary<String, Style>')

Rust error expected type `()` found type `(i32, i32)`

Value of type 'NSArray.Element' (aka 'Any') has no subscripts

Enforcing Type of Attribute of Argument of Custom Type

Error: EL1004E: Method call: Method rename(java.lang.String,java.lang.String) cannot be found on type com.jcraft.jsch.ChannelSftp$2

No index signature with a parameter of type 'string' was found on type '

No index signature with a parameter of type 'string' was found on type

Erro de instalação do Python3.7 mlpy - 'PyThreadState {aka struct _ts}' não tem membro com o nome 'exc_type'

Por que info @ example é válido de acordo com HTML5 <input type = "email">?

Dynamo DB Attribute type boolean

Hibernate and Date Type: length attribute

Create custom Moose attribute type

Why I Cannot subscript a value of type '[String : [String]]' with an argument of type 'String.SubSequence' (aka 'Substring')?

Swift Booleans not working: Cannot assign value of type 'Bool' to type 'BOOL' (aka 'Int32')

Why does this zig program fail to compile due to "expected error union type, found 'error:124:18'"?

Swift : Enum case not found in type

Not found: Op type not registered 'CountExtremelyRandomStats'

No property delete found for type Expense

The type or namespace "OpenGLEventArgs" could not be found

TOP lista

  1. 1

    R Shiny: use HTML em funções (como textInput, checkboxGroupInput)

  2. 2

    UITextView não está exibindo texto longo

  3. 3

    Dependência circular de diálogo personalizado

  4. 4

    Acessando relatório de campanhas na AdMob usando a API do Adsense

  5. 5

    Como assinar digitalmente um documento PDF com assinatura e texto visíveis usando Java

  6. 6

    R Folheto. Dados de pontos de grupo em células para resumir muitos pontos de dados

  7. 7

    Setas rotuladas horizontais apontando para uma linha vertical

  8. 8

    O Chromium e o Firefox exibem as cores de maneira diferente e não sei qual deles está fazendo certo

  9. 9

    Definir um clipe em uma trama nascida no mar

  10. 10

    Por que meus intervalos de confiança de 95% da minha regressão multivariada estão sendo plotados como uma linha de loess?

  11. 11

    Como dinamizar um Dataframe do pandas em Python?

  12. 12

    regex para destacar novos caracteres de linha no início e no fim

  13. 13

    Why isn't my C# .Net Core Rest API route finding my method?

  14. 14

    Como obter a entrada de trás de diálogo em treeview pyqt5 python 3

  15. 15

    Tabela CSS: barra de rolagem para a primeira coluna e largura automática para a coluna restante

  16. 16

    How to create dynamic navigation menu select from database using Codeigniter?

  17. 17

    Como recuperar parâmetros de entrada usando C #?

  18. 18

    Changing long, lat values of Polygon coordinates in python

  19. 19

    Livros sobre criptografia do muito básico ao muito avançado

  20. 20

    Método \ "POST \" não permitido no framework Django rest com ações extras & ModelViewset

  21. 21

    Pesquisa classificada, conte números abaixo do valor desejado

quentelabel

Arquivo