Olá, saudações a todos! Alguém já passou por esse problema ao tentar gerar um APK no Android Studio?
Android Studio: Jellyfish | 2023.3.1
Ionic:
Ionic CLI : 7.0.0 (C:\Users\tresa\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.1.2
@angular-devkit/build-angular : 13.0.4
@angular-devkit/schematics : 13.0.4
@angular/cli : 13.0.4
@ionic/angular-toolkit : 5.0.3
Capacitor:
Capacitor CLI : 3.4.1
@capacitor/android : 3.5.1
@capacitor/core : 3.5.1
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v18.19.1 (C:\Program Files\nodejs\node.exe)
npm : 10.2.4
OS : Windows 10
Namespace not specified. Specify a namespace in the module’s build file. See Configure the app module | Android Studio | Android Developers for information about setting the namespace.
If you’ve specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to Use the Android Gradle plugin Upgrade Assistant | Android Studio | Android Developers for general information about using the AGP Upgrade Assistant.
From the error message, it looks like you are trying to use Gradle 9.
Capacitor 3 uses Gradle 7 (source) so you probably need to downgrade.
In Android Studio go to:
- File → Project Structure… → Project
Then change Gradle Version to 7.0 and Android Gradle Plugin Version to 4.2.0.
Olá, obrigado por contribuir!
Mudou o erro agora, pelo que entendi esta pedindo para mudar a versão do java para 17.0.10, mas não tenho certeza se seria uma boa ideia atualizar essa versão
It should be fine to downgrade. Looks like you need to be on Java 16 with Gradle 7- Compatibility Matrix
Atualizei a versão do java 17 para 16:
Mas estou tendo este retorno abaixo:
Fiz algumas pesquisas e na tentativa de fazer funcionar, ajustei a versão do https://services.gradle.org/distributions/gradle-7.0-bin.zip para 7.0.2 e mesmo assim não deu certo.
O meu build.gradle esta assim:
E as versões da estrutura assim:
Trying restarting your computer
I had to do that for a different Java version to take affect in Android Studio.
After that, do a Gradle Sync and Clean/Rebuild - Troubleshooting Android Issues | Capacitor Documentation
Reiniciei a máquina, segui a documentação, e agora sigo neste retorno:
Estou pensando em refazer esse projeto em uma versão atualizada (fingir esquecer do tempo que levei para fazer
), por que, testei em criar um novo projeto de teste e consigo gerar APK sem problemas.
I’m not really sure on that error, it’s outside of my knowledge.
As you said, you would be better off upgrading to Capacitor 6 so you are on a supported version.
1 Like