android - Multiple support libraries conflicts using git submodules -


so have project multiple libraries attached submodules - means can't commit them.

each of libraries includes android support library, leads error

conversion dalvik format failed: unable execute dex: multiple dex files define... 

while trying build apk.

of course can remove duplicate support libraries library projects, won't able commit changes, , result use repo jenkins, etc.

for see 1 choice - fork libraries, remove conflicting jar them, , use forked versions submodules. honest, avoid it.

so, there way build apk multiple support libraries, or exclude libraries git submodules while cloning them?

if can automate (in script) remove of duplicate libraries references, register submodule repos smudge script would, on checkout, remove duplicate.

content filter

(from scott schacon's pro git book page on git attributes: section "keyword expansion")

each time update submodule sha1, smudge script automatically clean repo.

i on submodule copying filter want directly in parentrepo/.git/module/asubmodule/info/attribute.
see this script instance:

githubdir="${h}/.git/modules/gitlab" if [[ ! -e "${githubdir}/info/attributes" ]];   cp "${gtl}/config.gitlab" "${githubdir}/config"   cp "${gtl}/attributes.gitlab" "${githubdir}/info/attributes"   xxgit=1 git --work-tree="${github}" --git-dir="${githubdir}" checkout head -- "${github}" 

with attributes.gitlab being:

*.rb filter=fileexpandpath *.rake filter=fileexpandpath 

that call:

  • on checkout script fileexpandpath_replace (which trigger line above "git checkout head -- /path/to/submodule")
  • on checkin script fileexpandpath_restore (which might not need since won't doing commit in submodules)

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -