From 64a61a37d4772ba77be3d4890bf09c93b9cb35bb Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Mon, 25 Jun 2018 11:26:25 -0700 Subject: [PATCH] Fix Broken sample app (#103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: With this fix the entire android setup builds with gradle ✨. To try out the sample app, run `./gradlew :sample:installDebug` Closes https://github.com/facebook/Sonar/pull/103 Reviewed By: danielbuechele Differential Revision: D8618622 Pulled By: priteshrnandgaonkar fbshipit-source-id: 62a038f95c37cbadf48636a58ca222c8162e256e --- android/sample/build.gradle | 1 - libs/fbjni/cxx/fbjni/detail/References.cpp | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/android/sample/build.gradle b/android/sample/build.gradle index d27d3c761..920ed6d87 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -61,5 +61,4 @@ dependencies { implementation deps.okhttp3 implementation project(':android') - implementation project(':fbjni') } diff --git a/libs/fbjni/cxx/fbjni/detail/References.cpp b/libs/fbjni/cxx/fbjni/detail/References.cpp index adefe6545..11d7561c6 100644 --- a/libs/fbjni/cxx/fbjni/detail/References.cpp +++ b/libs/fbjni/cxx/fbjni/detail/References.cpp @@ -54,7 +54,10 @@ bool doesGetObjectRefTypeWork() { } bool isObjectRefType(jobject reference, jobjectRefType refType) { - static bool getObjectRefTypeWorks = doesGetObjectRefTypeWork(); + +// TODO Rather than setting it true, use doesGetObjectRefTypeWork(). But it +// causes sample app to freeze + static bool getObjectRefTypeWorks = true; return !reference ||