Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Cliabhach/b514c7740e1c2b74622c28d187b8556b to your computer and use it in GitHub Desktop.

Select an option

Save Cliabhach/b514c7740e1c2b74622c28d187b8556b to your computer and use it in GitHub Desktop.
Caused by: java.io.UncheckedIOException: java.nio.charset.MalformedInputException: Input length = 1
at com.android.ide.common.symbols.SymbolIo.readWithPackage(SymbolIo.java:205)
at com.android.ide.common.symbols.SymbolIo.readSymbolListWithPackageName(SymbolIo.java:182)
at com.android.ide.common.symbols.SymbolUtils.loadDependenciesSymbolTables(SymbolUtils.kt:184)
at com.android.builder.symbols.SymbolExportUtils.processLibraryMainSymbolTable(SymbolExportUtils.kt:82)
at com.android.build.gradle.internal.res.GenerateLibraryRFileTask.doFullTaskAction(GenerateLibraryRFileTask.kt:110)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
Web url: https://android.googlesource.com/platform/tools/base/+/studio-master-dev/sdk-common/src/main/java/com/android/ide/common/symbols/SymbolIo.java
Referenced commit: 7ee47d890c365a40dc31 (actual crash might've been observed against different hash)
Class-level docs:
/**
* Reads and writes symbol tables to files.
*
* <pre>
* AAR Format:
* - R.txt in AARs
* - Format is <type> <class> <name> <value>
* - Contains the resources for this library and all its transitive dependencies.
* - Written using writeForAar()
* - Only read as part of writeSymbolListWithPackageName() as there are corrupt files with
* styleable children not below their parents in the wild.
* - IDs and styleable children don't matter, as this is only used to filtering symbols when
* generating R classes.
* - public.txt in AARs
* - Format is <class> <name>
* - Contains all the resources from this AAR that are public (missing public.txt means all
* resources should be public)
* - There are no IDs or styleable children here, needs to be merged with R.txt and filtered by
* the public visibility to actually get a full list of public resources from the AAR
*
* AAPT2 Outputs the following formats:
* - R.txt as output by AAPT2, where ID values matter.
* - Format is <type> <class> <name> <value>
* - Read using readFromAapt().
* - This is what the R class is generated from.
* - Partial R file format.
* - Format is <access qualifier> <type> <class> <name>
* - Contains only the resources defined in a single source file.
* - Used to push R class generation earlier.
*
* Internal intermediates:
* - Symbol list with package name. Used to filter down the generated R class for this library in
* the non-namespaced case.
* - Format is <type> <name> [<child> [<child>, [...]]], with the first line as the package name.
* - Contains resources from this sub-project and all its transitive dependencies.
* - Read by readSymbolListWithPackageName()
* - Generated from AARs and AAPT2 symbol tables by writeSymbolListWithPackageName()
* - R def format,
* - Used for namespace backward compatibility.
* - Contains only the resources defined in a single library.
* - Has the package name as the first line.
* - May contain internal resource types (e.g. "maybe attributes" defined under declare
* styleable resources).
*
* All files are written in UTF-8. R files use linux-type line separators, while R.java use system
* line separators.
* </pre>
*/
Observed crash was on line 205:
if (!linesIterator.hasNext()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment