Fixed Android build with SDK revision 14

pull/13383/head
Andrey Kamaev 13 years ago
parent 177618984d
commit e8032fa8e9
  1. 19
      android/scripts/package.sh
  2. 12
      modules/java/CMakeLists.txt
  3. 12
      modules/java/android/project.properties
  4. 3
      samples/android/15-puzzle/project.properties
  5. 3
      samples/android/face-detection/project.properties
  6. 3
      samples/android/image-manipulations/project.properties
  7. 2
      samples/android/tutorial-0-androidcamera/project.properties
  8. 3
      samples/android/tutorial-1-addopencv/project.properties
  9. 3
      samples/android/tutorial-2-opencvcamera/project.properties
  10. 2
      samples/android/tutorial-3-native/project.properties
  11. 3
      samples/android/tutorial-4-mixed/project.properties

@ -33,7 +33,7 @@ cmake -C "$ANDROID_DIR/CMakeCache.android.initial.cmake" -DARM_TARGET="armeabi-v
make -j8 install/strip || exit 1
cd "$PRG_DIR/opencv"
rm -rf doc include src .classpath .project AndroidManifest.xml default.properties share/OpenCV/haarcascades share/OpenCV/lbpcascades share/OpenCV/*.cmake share/OpenCV/OpenCV.mk
rm -rf doc include src .classpath .project AndroidManifest.xml default.properties project.properties share/OpenCV/haarcascades share/OpenCV/lbpcascades share/OpenCV/*.cmake share/OpenCV/OpenCV.mk
# armeabi build
@ -67,15 +67,26 @@ for dir in `ls -1`
do
if [ -f "$dir/default.properties" ]
then
HAS_REFERENCE=`cat "$dir/default.properties" | grep -c android.library.reference.1`
HAS_REFERENCE=`cat "$dir/project.properties" | grep -c android.library.reference.1`
if [ $HAS_REFERENCE = 1 ]
then
echo -n > "$dir/default.properties"
echo -n > "$dir/project.properties"
android update project --name "$dir" --target "android-8" --library "../../$OPENCV_NAME" --path "$dir"
#echo 'android update project --name "$dir" --target "android-8" --library "../opencv$CV_VERSION" --path "$dir"'
fi
else
rm -rf "$dir"
if [ -f "$dir/default.properties" ]
then
HAS_REFERENCE=`cat "$dir/default.properties" | grep -c android.library.reference.1`
if [ $HAS_REFERENCE = 1 ]
then
echo -n > "$dir/default.properties"
android update project --name "$dir" --target "android-8" --library "../../$OPENCV_NAME" --path "$dir"
#echo 'android update project --name "$dir" --target "android-8" --library "../opencv$CV_VERSION" --path "$dir"'
fi
else
rm -rf "$dir"
fi
fi
done

@ -214,7 +214,17 @@ if(ANDROID)
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/res"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/gen"
DEPENDS ${lib_proj_files}
)
)
if (ANT_EXECUTABLE AND ANDROID_EXECUTABLE AND ANDROID_TOOLS_Pkg_Revision GREATER 13)
add_custom_command(
TARGET ${target}
COMMAND ${ANDROID_EXECUTABLE} update lib-project --path "${CMAKE_BINARY_DIR}"
COMMAND ${ANT_EXECUTABLE} debug
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS ${lib_target}
)
endif()
add_dependencies(${lib_target} ${api_target})
add_dependencies(${target} ${lib_target})

@ -0,0 +1,12 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
android.library=true
# Project target.
target=android-8

@ -0,0 +1,3 @@
android.library.reference.1=../../../android/build
# Project target.
target=android-8

@ -0,0 +1,3 @@
android.library.reference.1=../../OpenCV-2.3.1
# Project target.
target=android-8

@ -0,0 +1,3 @@
android.library.reference.1=../../../android/build
# Project target.
target=android-8

@ -0,0 +1,2 @@
# Project target.
target=android-8

@ -0,0 +1,3 @@
android.library.reference.1=../../../android/build
# Project target.
target=android-8

@ -0,0 +1,3 @@
android.library.reference.1=../../../android/build
# Project target.
target=android-8

@ -0,0 +1,2 @@
# Project target.
target=android-8

@ -0,0 +1,3 @@
android.library.reference.1=../../../android/build
# Project target.
target=android-8
Loading…
Cancel
Save