Ошибка
Execution failed for task ':appcenter-analytics:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction
> Incorrect package="com.microsoft.appcenter.reactnative.analytics" found in source AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.microsoft.appcenter.reactnative.analytics" from the source AndroidManifest.xml.
< /code>
Я получаю эту ошибку при попытке запустить нативное приложение Android React после обновления AGP с помощью помощника по обновлению AGP (в Android Studio) с 7.4.2 до 8.2.1 (& Gradle версия 8.2). < /P>
Я уже указал пространство имен.android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion 34
namespace "com.example"
...
Но, как видно из ошибки, проблема связана с зависимостью подпроекта. Кажется, что с этой проблемой связано много (>10) таких зависимостей. Я думаю, что это связано с тем, что они не указали пространство имен.
Я последовал совету из этого ответа https://stackoverflow.com/a/77738936/23282142 в аналогичном сообщении, которое пытается добавить пространство имен ко всем подпроектам, если у них его еще нет. Но это не решило проблему. Вот мой файл build.gradle верхнего уровня:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.8.22'
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
playServicesLocationVersion = "21.0.1"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath('com.android.tools.build:gradle:8.2.1')
classpath("com.google.gms:google-services:4.4.0")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
// From https://stackoverflow.com/questions/761 ... oid-studio
allprojects {
// This code is where all the magic happens and fixes the error.
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
// This code is where all the magic happens and fixes the error.
}
Подробнее здесь: https://stackoverflow.com/questions/778 ... rce-androi
Как исправить «Установка пространства имен с помощью атрибута пакета в исходном файле AndroidManifest.xml больше не подд ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
В PHP пространства имен xml переобъявляются при изменении префикса пространства имен.
Anonymous » » в форуме Php - 0 Ответы
- 132 Просмотры
-
Последнее сообщение Anonymous
-