Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

IndraTheZeus
Copy link

@IndraTheZeus IndraTheZeus commented Jul 25, 2024

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

@IndraTheZeus IndraTheZeus requested review from a team as code owners July 25, 2024 13:13
@github-actions github-actions bot added the category: java API OpenVINO Runtime Java API label Jul 25, 2024
@likholat likholat requested a review from allnes July 30, 2024 11:12
IndraTheZeus and others added 2 commits July 31, 2024 16:52
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"
Copy link
Contributor

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}"
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sames sa with logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: java API OpenVINO Runtime Java API platform: android OpenVINO on Android
Projects
None yet
3 participants