This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 428
Conflict with React Native in v2.0.2 #199
Comments
Currently using a very annoying workaround where I strip the duplicated classes from the aar file, and then include it as a local dependency: # Download original
curl http://central.maven.org/maven2/com/facebook/conceal/conceal/2.0.2/conceal-2.0.2.aar > conceal-2.0.2.aar
# Unpack aar
unzip conceal-2.0.2.aar -d temp-folder
# Strip duplicate so files
rm jni/*/libfb.so
# Unpack classes
cd temp-folder
unzip classes.jar -d temp-folder
# Strip duplicate classes
rm -r temp-folder/com/facebook/{jni,proguard,soloader}
# Pack classes
jar cvf classes.jar -C temp-folder/ .
rm -r temp-folder
# Pack aar
cd ..
jar cvf conceal-2.0.2-stripped.aar -C temp-folder/ .
rm -r temp-folder |
configurations {
repack { transitive = false }
}
ext.concealVersion = "2.0.2"
dependencies {
/* https://github.com/facebook/conceal/releases */
repack "com.facebook.conceal:conceal:${concealVersion}"
}
task repackConcealv2(dependsOn: configurations.repack) {
def generation = "${project.buildDir}/intermediates/repack"
def conceal = "com.facebook.conceal@${concealVersion}"
def destination = "${generation}/${conceal}"
doLast {
copy {
from { zipTree(configurations.repack.singleFile) }
into "${destination}"
}
copy {
from zipTree("${destination}/classes.jar")
into "${destination}/classes"
}
}
task recreateConcealAarv2(type: Zip) {
archiveFileName = "com.facebook.conceal-${concealVersion}-patched.aar"
destinationDirectory = file("${generation}")
from("${destination}") {
exclude '**/jni/*/libfb.so'
exclude '**/classes'
exclude 'classes.jar'
rename('classes-patched.jar', 'classes.jar')
}
}
task recreateConcealClassesJarv2(type: Zip) {
archiveFileName = "classes-patched.jar"
destinationDirectory = file("${destination}")
from("${destination}/classes") {
exclude '**/facebook/jni/'
exclude '**/facebook/proguard/'
exclude '**/facebook/soloader/'
}
finalizedBy recreateConcealAarv2
}
finalizedBy recreateConcealClassesJarv2
}
preBuild.dependsOn(repackConcealv2)
dependencies {
implementation fileTree(dir: "${project.buildDir}/intermediates/repack", include: ["*-patched.aar"])
} Outputs:
|
Any Update on this..? |
@OleksandrKucherenko , I followed your approach but after that native library loading is failing. |
Yes, I saw that before... it happens due to the not properly found @aar file. The workaround is to divide the build process into two steps:
|
We had patched the aar according to @LinusU. But still facing the error. By the way, we are using conceal 2.0.2 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Similar to #102 and #196, there is a conflict in the 2.0.2 version as well:
Seems like both conceal and react-native is defining
com.facebook.jni.Countable
.Would be happy to submit a pull request if someone can guide me to what the proper fix is☺️
The text was updated successfully, but these errors were encountered: