-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java_api] [coco_detection_android_demo] Updating build.gradle to build libraries in Linux for android deployment #927
base: master
Are you sure you want to change the base?
Conversation
...oid_demos/coco_detection_android_demo/app/src/main/java/org/intel/openvino/MainActivity.java
Show resolved
Hide resolved
Co-authored-by: Anna Likholat <aniali201398@gmail.com>
@@ -14,7 +14,7 @@ def nativesCPP; | |||
def openvinoVersion = "2024.2" | |||
|
|||
def native_resources = [] | |||
def tbb_dir = System.getenv('TBB_DIR') | |||
def tbb_dir = System.getenv('TBB_DIR') ?: System.getenv('OPV_HOME_DIR') + "/one-tbb-install/lib/cmake/TBB" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one-tbb-install directory can be changed, it's just example and there cannot be a universal way to find TBB, that why System.getenv('TBB_DIR') is required
@@ -34,15 +34,18 @@ if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") { | |||
ov_arch = "armhf"; | |||
} | |||
|
|||
def openVinoDir = System.getenv('INTEL_OPENVINO_DIR') ?: System.getenv('OPV_HOME_DIR') + "/openvino_install" | |||
println ">>> INTEL_OPENVINO_DIR -> ${openVinoDir}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add logging or remove simple print messages in demos
@@ -34,15 +34,18 @@ if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") { | |||
ov_arch = "armhf"; | |||
} | |||
|
|||
def openVinoDir = System.getenv('INTEL_OPENVINO_DIR') ?: System.getenv('OPV_HOME_DIR') + "/openvino_install" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as TBB
@@ -58,6 +61,7 @@ native_resources.each { | |||
tree.visit { FileVisitDetails details -> | |||
if (!details.file.isDirectory()) { | |||
resources_list += details.file.name + "\n" | |||
println ">>> Adding ${details.file.name} to native_resources" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sames sa with logging
When building the openvino-java-api.jar, if you do not build in android OS you end up building the incorrect libraries leading to errors like java.lang.UnsatisfiedLinkError: No implementation found for long org.intel.openvino.Core.GetCore() (tried Java_org_intel_openvino_Core_GetCore and Java_org_intel_openvino_Core_GetCore__) - is the library loaded, e.g. System.loadLibrary?
In order to solve this, you must change the build.gradle file to the correct variables for the libraries are set and discovered
This issue was discovered by @Kabor42 from IRF Solutions KFT. Budapest, Hungary. It fixes #926