The R2 value generated by butterknife in library is not the same as the R value.

one of my projects is like this

  • app (application)
  • login (library/application)

in login , I use the R2 value generated by butterknife , similar to R2.layout.login , which is copied and modified into a constant ( fainl ) from the R file of the login module.

now encounters a problem when login is no longer used as application , using libaray and then being dependent into the main project app .
this R2.layout.login does not have the same value as the generated R.layout.login .

what should I do, please?

this is the current R and R2

    1. login/R.layout.login     // androidgradle taskfinal 
    2. login/R2.layout.login     //butterknifepluginR
    3. app/R.layout.login       //androidgradle taskapk
    4. app/R2.layout.login      //butterknifeR

now the value of 1 and 2 is the same, the value of 2 used in my code,
3 and 4 are the same, which is really the value of the resource packaged into apk , because the value of 2 is not the same as here, so my code will report an error.

after trying, there is no way to solve it. I hope I can give a hint

Mar.18,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3792e-e5f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3792e-e5f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?