Задача: приложение: mergedebugresources не удалось < /li>
< /ol>
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
> Resource compilation failed (Failed to compile values resource file D: \android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException:Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml). Check logs for more details.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.
< /code>
`
2. Извлеченный контент из строк 24 по 68 в сгенерированном \ слиянии. dir \ values \ values.xml < /p>
execution /gradlew mergedebugresources -info -stacktrace
Вот несколько журналов < /li>
< /ol>
Compiling file D:\android\app\src\main\res\mipmap-xhdpi\ic_exercise_detail_result.png to D:\android\app\build\intermediates\merged_res\debug\mergeDebugResources\mipmap-xhdpi_ic_exercise_detail_result.png.flat
Compiling xml file D: \android\tricare_android\app\src\main\res\layout\activity_passcode_lock_cover_screen.xml to D: \android\app\build\intermediates\merged_res\debug\mergeDebugResources\layout_activity_passcode_lock_cover_screen.xml.flat
D:\android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml: Failed to compile file
Compiling xml file D:\android\app\src\main\res\drawable\bg_sa0249_round_normal.xml to D:\android\app\build\intermediates\merged_res\debug\mergeDebugResources\drawable_bg_sa0249_round_normal.xml.flat
< /code>
Caused by: java.nio.file.InvalidPathException: Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml
at com.android.tools.build.bundletool.model.utils.files.FileUtils.getPath(FileUtils.java:101)
at com.android.build.gradle.internal.res.Aapt2ErrorUtils$blameLoggerFor$2.invoke(Aapt2ErrorUtils.kt:188)
at com.android.build.gradle.internal.res.Aapt2ErrorUtils$blameLoggerFor$2.invoke(Aapt2ErrorUtils.kt:187)
at com.android.aaptcompiler.BlameLogger.getOriginalSource(BlameLogger.kt:132)
at com.android.aaptcompiler.ResourceTable.addResourceImpl(ResourceTable.kt:360)
at com.android.aaptcompiler.ResourceTable.addResourceWithId(ResourceTable.kt:80)
at com.android.aaptcompiler.TableExtractor.addResourceToTable(TableExtractor.kt:2098)
at com.android.aaptcompiler.TableExtractor.addResourceToTable(TableExtractor.kt:2111)
at com.android.aaptcompiler.TableExtractor.extractResourceValues(TableExtractor.kt:265)
at com.android.aaptcompiler.TableExtractor.extract(TableExtractor.kt:181)
at com.android.aaptcompiler.ResourceCompiler.compileTable(ResourceCompiler.kt:188)
< /code>
` Regarding the Android upgrade, we are attempting to compile and run the Android project while upgrading from compileSdk 31 to 34 or 36, and encountered this error
Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml
Resolve through the following 17 ways
Temporarily remove all XML files under res/values/
Gradle did not find any illegal colon characters in the temporary path generated during resource merging
Backup the entire layout and Java code to another folder, and delete the contents of both folders
Since the project has already removed the layout and Java code, all defined properties in attrs.xml will be deleted
Binary search, first annotate half, then compile again
When searching the generated \ merge. dir \ values \ values.xml file, no duplicate attributes were found with the attrs.xml file
Add prefixes to all attributes in attrs.xml
But in the end, the problem was still not solved, Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml, What other problems could there be and how should they be solved specifically`
[list] [*] Задача: приложение: mergedebugresources не удалось < /li> < /ol> Execution failed for task ':app:mergeDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable > Resource compilation failed (Failed to compile values resource file D: \android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException:Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml). Check logs for more details.
* Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to generate a Build Scan (Powered by Develocity). > Get more help at https://help.gradle.org. < /code> ` 2. Извлеченный контент из строк 24 по 68 в сгенерированном \ слиянии. dir \ values \ values.xml < /p>
execution /gradlew mergedebugresources -info -stacktrace Вот несколько журналов < /li> < /ol> Compiling file D:\android\app\src\main\res\mipmap-xhdpi\ic_exercise_detail_result.png to D:\android\app\build\intermediates\merged_res\debug\mergeDebugResources\mipmap-xhdpi_ic_exercise_detail_result.png.flat Compiling xml file D: \android\tricare_android\app\src\main\res\layout\activity_passcode_lock_cover_screen.xml to D: \android\app\build\intermediates\merged_res\debug\mergeDebugResources\layout_activity_passcode_lock_cover_screen.xml.flat D:\android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml: Failed to compile file Compiling xml file D:\android\app\src\main\res\drawable\bg_sa0249_round_normal.xml to D:\android\app\build\intermediates\merged_res\debug\mergeDebugResources\drawable_bg_sa0249_round_normal.xml.flat < /code> Caused by: java.nio.file.InvalidPathException: Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml at com.android.tools.build.bundletool.model.utils.files.FileUtils.getPath(FileUtils.java:101) at com.android.build.gradle.internal.res.Aapt2ErrorUtils$blameLoggerFor$2.invoke(Aapt2ErrorUtils.kt:188) at com.android.build.gradle.internal.res.Aapt2ErrorUtils$blameLoggerFor$2.invoke(Aapt2ErrorUtils.kt:187) at com.android.aaptcompiler.BlameLogger.getOriginalSource(BlameLogger.kt:132) at com.android.aaptcompiler.ResourceTable.addResourceImpl(ResourceTable.kt:360) at com.android.aaptcompiler.ResourceTable.addResourceWithId(ResourceTable.kt:80) at com.android.aaptcompiler.TableExtractor.addResourceToTable(TableExtractor.kt:2098) at com.android.aaptcompiler.TableExtractor.addResourceToTable(TableExtractor.kt:2111) at com.android.aaptcompiler.TableExtractor.extractResourceValues(TableExtractor.kt:265) at com.android.aaptcompiler.TableExtractor.extract(TableExtractor.kt:181) at com.android.aaptcompiler.ResourceCompiler.compileTable(ResourceCompiler.kt:188) < /code> ` Regarding the Android upgrade, we are attempting to compile and run the Android project while upgrading from compileSdk 31 to 34 or 36, and encountered this error Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml Resolve through the following 17 ways
Temporarily remove all XML files under res/values/
[*]Gradle did not find any illegal colon characters in the temporary path generated during resource merging
[*]The settings in gradle.com are as follows org.gradle.jvmargs=-Xmx4g - XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
[*]Add a prefix to the resources of each module: resourceInitialize "module1_"
[*]The old version that has been discarded and unused has been modified to the new version
[*]Formatted="false" for all% values added in string.xml
[*]Add android.overridePathCheck=true to bypass path validation in gradle.com
[*]Generate file cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml, checked that the C drive does not contain the path to 51:
[*]Check the package attribute naming in AndroidManifest.xml for all modules, using all lowercase
[*]Force setting in gradle.com: textCopy Code android.useNewApkCreator=true android.enableAapt2=true
[*] [/list] aaptOptions { additionalParameters "--no-version-vectors" ignoreAssetsPattern= "!.svn:!.git:!.ds_store:!*.scc:.*:_*:!CVS:!thumbs.db:! picasa.ini:!*~" } < /code> packagingOptions { pickFirst '**/values.xml' } < /code> [list] [*]Backup the entire layout and Java code to another folder, and delete the contents of both folders Since the project has already removed the layout and Java code, all defined properties in attrs.xml will be deleted [*]Binary search, first annotate half, then compile again [*]When searching the generated \ merge. dir \ values \ values.xml file, no duplicate attributes were found with the attrs.xml file [*]Add prefixes to all attributes in attrs.xml But in the end, the problem was still not solved, Illegal char at index 45: cn.iso.product.projectname-mergeDebugResources-51:/values/values.xml, What other problems could there be and how should they be solved specifically` [/list]
Я не могу скомпилировать свое приложение из -за этой ошибки
com.android.aaptcompiler.ResourceCompilationException:
Resource compilation failed
(Failed to compile values resource file...
Я не могу скомпилировать свое приложение из -за этой ошибки
com.android.aaptcompiler.ResourceCompilationException:
Resource compilation failed
(Failed to compile values resource file...
У меня есть приложение для Android, которое поддерживает несколько языков: английский, украинский и русский. Приложение отлично работает при установке непосредственно из Android Studio на любое устройство . Однако при загрузке приложения из Google...
У меня есть приложение для Android, которое поддерживает несколько языков: английский, украинский и русский. Приложение отлично работает при установке непосредственно из Android Studio на любое устройство . Однако при загрузке приложения из Google...