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

Fix missing file libtaichi_c_api.so in Android App #130

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion scripts/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ set -e
rm -rf build-android-aarch64
mkdir build-android-aarch64
pushd build-android-aarch64
TAICHI_C_API_INSTALL_DIR="${PWD}/../build-taichi-android-aarch64/install/c_api" cmake .. \

C_API_DIR="${PWD}/../build-taichi-android-aarch64/install/c_api"

TAICHI_C_API_INSTALL_DIR=${C_API_DIR} cmake .. \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" \
-DANDROID_PLATFORM=android-29 \
-DANDROID_ABI="arm64-v8a" \
Expand All @@ -21,3 +24,19 @@ if [ $? -ne 0 ]; then
exit -1
fi
popd

# Check for libtaichi_c_api.so
target_file="${PWD}/framework/android/app/src/main/jniLibs/arm64-v8a/libtaichi_c_api.so"
source_file="${C_API_DIR}/lib/libtaichi_c_api.so"

if [ ! -f "$target_file" ]; then
echo "File not found: $target_file"
echo "Copying from $source_file to $target_file"

cp "$source_file" "$target_file"
chmod 775 "$target_file"

echo "File copied and permissions set."
else
echo "File already exists: $target_file"
fi
Loading