Незаконный char <:> в индексе 45: cn.iso.product.projectname-mergedebugresources-51: /values/values.xmlAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Незаконный char <:> в индексе 45: cn.iso.product.projectname-mergedebugresources-51: /values/values.xml

Сообщение Anonymous »

  • Задача: приложение: 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>

    @string/break_fast
    @string/lunch
    @string/dinner
    @string/snack
    @string/night


    @string/medicine_regis_selection_text_search_medicine
    @string/medicine_regis_selection_text_enter_medicine
    @string/medicine_regis_selection_text_qrcode
    @string/medicine_regis_selection_text_prescription_history
    @string/s0307_medicine_regis_selection_text_myhome


    @string/medicine_regis_selection_text_search_medicine
    @string/medicine_regis_selection_text_enter_medicine
    @string/medicine_regis_selection_text_qrcode


    @string/medicine_register_interval_everyday
    @string/medicine_register_interval_one_per_day
    @string/medicine_register_interval_two_per_day
    @string/medicine_register_interval_three_per_day
    @string/medicine_register_interval_four_per_day
    @string/medicine_register_interval_five_per_day
    @string/medicine_register_interval_weekly
    @string/medicine_register_interval_monthly


    @string/medicine_register_unit_none
    @string/medicine_register_unit_tablet
    @string/medicine_register_unit_individual
    @string/medicine_register_unit_capsule_1
    @string/medicine_register_unit_sheet_1
    @string/medicine_register_unit_book
    @string/medicine_register_unit_bag
    @string/medicine_register_unit_cylinder
    @string/medicine_register_unit_gram
    @string/medicine_register_unit_ml
    @string/medicine_register_unit_capsule_2
    @string/medicine_register_unit_sheet_2
    @string/medicine_register_unit_blister
    @string/medicine_register_unit_other

    < /code>

    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
  • Include ': app' in settings. gradle
  • Gradle: distributionUrl=https://services.gradle.org/distributio ... .0-bin.zip
    AGP version: classpath 'com. android. tools. build: Gradle: 8.11.0'
  • 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
aaptOptions {
additionalParameters "--no-version-vectors"
ignoreAssetsPattern= "!.svn:!.git:!.ds_store:!*.scc:.*:_*:!CVS:!thumbs.db:! picasa.ini:!*~"
}
< /code>
packagingOptions {
pickFirst '**/values.xml'
}
< /code>
  • 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`


Подробнее здесь: https://stackoverflow.com/questions/797 ... sources-51
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»