fataar-gradle-plugin icon indicating copy to clipboard operation
fataar-gradle-plugin copied to clipboard

R.txt cannot generate

Open stanleychan opened this issue 6 years ago • 8 comments

What are the steps to reproduce this issue?

  1. …gradle version 3.2.1
  2. …the dependencies in both library submodule contains android support lib
  3. …gradle procedure stop at the copyreleasedependencies function, the output variant is abc_fade_in 0x7f010001. I consider when this error will occur when this value appears in different R.txt which will be merged

What happens?

…R.txt cannot generate

What were you expecting to happen?

…Generate the R.txt

stanleychan avatar Dec 28 '18 08:12 stanleychan

@stanleychan I have the same issue, i solve this by changing: classpath 'com.mobbeel.plugin:fat-aar:2.0.3' to classpath 'com.mobbeel.plugin:fat-aar:2.0.2' in build.gradle projects and the error gone.

xenixcorp avatar Jan 02 '19 09:01 xenixcorp

@xenixcorp Yep,I have rolled back to the 2.0.2, and downgraded gradle to 3.1.3. The fataar 2.02 is not compatible for gradle 3.2+ even though there is not error in build procedure.(The R.txt lost resource index value)

stanleychan avatar Jan 02 '19 11:01 stanleychan

confirmed with Gradle 4.8

m-ivanov avatar Jan 04 '19 14:01 m-ivanov

I'm willing to spend some time to fix this (company I'm working for needs it). Any ideas where to look to fix it? @oscarcpozas

TomTasche avatar Jan 04 '19 15:01 TomTasche

Tried to look into this but I don't have enough knowledge about the gradle / Android build internals unfortunately. It fails on R-entries like this: int[] styleable ActionBar { 0x7f040033, 0x7f040034, 0x7f040035, 0x7f04005a, 0x7f04005b, 0x7f04005c, 0x7f04005d, 0x7f04005e, 0x7f04005f, 0x7f040062, 0x7f040066, 0x7f040067, 0x7f040072, 0x7f040083, 0x7f040084, 0x7f040085, 0x7f040086, 0x7f040087, 0x7f04008c, 0x7f04008f, 0x7f0400a3, 0x7f0400ac, 0x7f0400b7, 0x7f0400ba, 0x7f0400bb, 0x7f0400d6, 0x7f0400d9, 0x7f0400f4, 0x7f0400fd }

As far as I understand, it fails because this is not present in the resourcesOriginal-file. To me it looks like the format of the original file changed...? @oscarcpozas

This is the code block where it is failing: https://github.com/Mobbeel/fataar-gradle-plugin/blob/master/buildSrc/src/main/groovy/com/mobbeel/plugin/task/CopyDependenciesTask.groovy#L246

TomTasche avatar Jan 06 '19 10:01 TomTasche

@stanleychan @TomTasche @m-ivanov @xenixcorp sorry for late response.

Currently, the plugin doesn't support Gradle plugin 3.2.x. In 2.0.3 version I started the development to give support to it but it isn't finished yet.

The code block that @TomTasche comments on is necessary to generate R class because on this version of Gradle plugin it's not that simple than copy the file to AAR artifact like older versions. Any help with this is welcome <3

oscarcpozas avatar Jan 10 '19 12:01 oscarcpozas

Do you have any suggestions where to look, what to do, what could be wrong, etc? I really tried to fix it but I'm not able to because I don't understand what all these files are that are being merged... If you could give me concrete suggestions how to fix I'd be happy to do so!

TomTasche avatar Jan 10 '19 15:01 TomTasche

fat-aar plugin doesn't support 3.2.x Gradle plugin yet, I'm working on it. You can see the advances in this issue (#28)

oscarcpozas avatar Jan 30 '19 17:01 oscarcpozas