Plug-in Android per Gradle 7.4.0 (gennaio 2023)
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Il plug-in Android per Gradle 7.4.0 è una release principale che include una serie di nuove
funzionalità e miglioramenti.
Compatibilità
Report post-upgrade e funzionalità di rollback dell'assistente per l'upgrade di AGP
L'assistente all'upgrade di AGP ora include un report post-upgrade. Questo report
descrive i passaggi completati e indica se l'upgrade è stato eseguito correttamente o
meno. Include anche un'azione per ripristinare le modifiche apportate
dall'assistente all'upgrade, in caso di problemi di compilazione o test del progetto
dopo l'upgrade.
L'importazione del progetto viene eseguita in parallelo
L'IDE Studio ora importa i progetti in parallelo quando utilizzi Gradle 7.4.2 o versioni successive e il plug-in Android Gradle 7.2.0 o versioni successive. Nello specifico, quando Android
Studio attiva una sincronizzazione Gradle, le informazioni che descrivono i progetti inclusi
nella build vengono create in parallelo. In genere, questo velocizza la sincronizzazione,
soprattutto per i progetti più grandi. I benchmark mostrano che il tempo necessario
per creare modelli Gradle per un progetto molto grande (con 3500 progetti secondari Gradle)
si riduce del 50%, da 10 minuti a 5 minuti.
Il plug-in Android per Gradle ha come target il bytecode JVM 11
A partire dal plug-in Android per Gradle 7.4.0-alpha04, AGP viene fornito con bytecode JVM 11. Ciò significa che se compili in base ad AGP o scrivi controlli Lint personalizzati, devi iniziare a scegliere come target il bytecode JVM 11. Uno dei modi per farlo
è includere quanto segue nel file build.gradle
a livello di modulo:
sourceCompatibility = "11"
targetCompatibility = "11"
Release delle patch
Di seguito è riportato un elenco delle patch rilasciate per il plug-in Android per Gradle
7.4.
Plug-in Android per Gradle 7.4.1 (febbraio 2023)
Questo aggiornamento secondario include le seguenti correzioni di bug:
Problemi risolti |
Esegui la migrazione dalla proprietà destination alla proprietà outputLocation per risolvere l'avviso di ritiro e prepararti per Gradle 9.0
|
AGP 7.4.0-rc01 interrompe l'API Variant con "Querying the mapped value of
map(provider(java.util.Set)) before task '...' has completed is not supported"
|
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-09-05 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[],[],null,["Android Gradle Plugin 7.4.0 is a major release that includes a variety of new\nfeatures and improvements.\n\nCompatibility\n\n\n| | Minimum version | Default version | Notes |\n|----------------:|:---------------:|:---------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------:|\n| Gradle | 7.5 | 7.5 | To learn more, see [updating Gradle](/build/releases/gradle-plugin?buildsystem=ndk-build#updating-gradle). |\n| SDK Build Tools | 30.0.3 | 30.0.3 | [Install](/studio/intro/update#sdk-manager) or [configure](/tools/releases/build-tools) SDK Build Tools. |\n| NDK | N/A | 23.1.7779620 | [Install](/studio/projects/install-ndk#specific-version) or [configure](/studio/projects/install-ndk#apply-specific-version) a different version of the NDK. |\n| JDK | 11 | 11 | To learn more, see [setting the JDK version](/studio/intro/studio-config#jdk). |\n\n\u003cbr /\u003e\n\nAGP Upgrade Assistant post-upgrade report and rollback functionality\n\nThe AGP Upgrade Assistant now includes a post-upgrade report. This report\ndescribes the steps that were completed and if the upgrade was successful or\nunsuccessful. It also includes an action to revert changes that were made by\nthe upgrade assistant, if there are issues building or testing the project\nafter the upgrade.\n\nProject import runs in parallel\n\nThe Studio IDE now imports projects in parallel when you use Gradle 7.4.2 or\nhigher and Android Gradle plugin 7.2.0 or higher. Specifically, when Android\nStudio triggers a Gradle sync, the information that describes projects included\nin your build is created in parallel. This usually speeds up the syncing\nprocess, especially for larger projects. Benchmarks show that the time it takes\nto build Gradle models for a very large project (with 3,500 Gradle subprojects)\nis reduced by 50%, from 10 minutes to 5 minutes.\n\nAndroid Gradle plugin targets JVM 11 bytecode\n\nStarting with Android Gradle plugin 7.4.0-alpha04, AGP ships wth JVM 11\nbytecode. This means that if you compile against AGP, or write custom Lint\nchecks, you need to start targeting JVM 11 bytecode. One of the ways to do this\nis to include the following in your module-level `build.gradle` file: \n\n sourceCompatibility = \"11\"\n targetCompatibility = \"11\"\n\nPatch releases\n\n\u003cbr /\u003e\n\nThe following is a list of the patch releases for Android Gradle Plugin\n7.4.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nAndroid Gradle Plugin 7.4.1 (February 2023)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis minor update includes the following bug fixes:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Fixed issues ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Issue #242831042](https://issuetracker.google.com/issues/242831042) Migrate from `destination` property to `outputLocation` property to address deprecation warning and prepare for Gradle 9.0 |\n| [Issue #261329823](https://issuetracker.google.com/issues/261329823) AGP 7.4.0-rc01 breaks Variant API with \"Querying the mapped value of `map(provider(java.util.Set))` before task '...' has completed is not supported\" |\n\n\u003cbr /\u003e"]]