From a93f8e0e5768cba87aab753b44ae151567fa59c0 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Fri, 22 Dec 2017 20:19:55 +0100 Subject: [PATCH 1/3] remove obsolete files --- .gitignore | 8 +- .idea/.name | 1 - .idea/compiler.xml | 22 ----- .idea/copyright/profiles_settings.xml | 3 - .idea/encodings.xml | 6 -- .idea/gradle.xml | 20 ----- .idea/misc.xml | 88 ------------------- .idea/modules.xml | 11 --- .idea/runConfigurations.xml | 12 --- .idea/vcs.xml | 6 -- OpenCV-AndroidSamples.iml | 19 ---- app/app.iml | 119 -------------------------- libraries/libraries.iml | 25 ------ libraries/opencv/opencv.iml | 91 -------------------- 14 files changed, 3 insertions(+), 428 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations.xml delete mode 100644 .idea/vcs.xml delete mode 100644 OpenCV-AndroidSamples.iml delete mode 100644 app/app.iml delete mode 100644 libraries/libraries.iml delete mode 100644 libraries/opencv/opencv.iml diff --git a/.gitignore b/.gitignore index d1a39bd..61482ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ .gradle /gradle.properties /local.properties -/.idea/workspace.xml -/.idea/libraries +.idea .DS_Store -/build -/captures -/libraries/opencv/build +build +*.iml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 584aa45..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -OpenCV-AndroidSamples \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 9a8b7e5..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 952fac0..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index ad84ebe..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Android - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 61559e5..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 6564d52..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/OpenCV-AndroidSamples.iml b/OpenCV-AndroidSamples.iml deleted file mode 100644 index 3476cd8..0000000 --- a/OpenCV-AndroidSamples.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index 15475ef..0000000 --- a/app/app.iml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libraries/libraries.iml b/libraries/libraries.iml deleted file mode 100644 index 690d099..0000000 --- a/libraries/libraries.iml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libraries/opencv/opencv.iml b/libraries/opencv/opencv.iml deleted file mode 100644 index 8af609f..0000000 --- a/libraries/opencv/opencv.iml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From d12178126604e77447b69ec0590fdc85766b0a53 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Fri, 22 Dec 2017 21:15:22 +0100 Subject: [PATCH 2/3] update build tools and gradle --- app/build.gradle | 28 +++++++++++++----------- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- gradlew | 0 libraries/opencv/build.gradle | 5 +++-- 5 files changed, 21 insertions(+), 18 deletions(-) mode change 100644 => 100755 gradlew diff --git a/app/build.gradle b/app/build.gradle index 72f103a..68f5176 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.model.application' model { android { compileSdkVersion = 22 - buildToolsVersion = "23.0.0" + buildToolsVersion = "25.0.3" defaultConfig.with { applicationId = "com.jnardari.opencv_androidsamples" @@ -17,7 +17,7 @@ model { android.buildTypes { release { minifyEnabled = false - proguardFiles += file('proguard-rules.pro') + proguardFiles.add(file('proguard-rules.pro')) } } @@ -26,55 +26,57 @@ model { */ android.ndk { moduleName = "ndklibrarysample" - cppFlags += ["-std=c++11", "-fexceptions", "-frtti"] - cppFlags += "-I${file("C:/Users/jnardari/Desktop/OpenCV-android-sdk/sdk/native/jni/include")}".toString() - ldLibs += ["android", "EGL", "GLESv2", "dl", "log", "z"] + CFlags.add("-std=c++11") + CFlags.add("-fexceptions") + CFlags.add("-frtti") + CFlags.add("-I${file("~/git/openCV/openCV-3.3.1/sdk/native/jni/include")}".toString()) // download it here https://www.opencv.org/releases.html + ldLibs.addAll("android", "EGL", "GLESv2", "dl", "log", "z") stl = "gnustl_static" } android.productFlavors { create("arm") { ndk.with { - abiFilters += "armeabi" + abiFilters.addAll("armeabi") File curDir = file('./') curDir = file(curDir.absolutePath) String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\armeabi\\" - ldLibs += libsDir + "libopencv_java3.so" + ldLibs.addAll(libsDir + "libopencv_java3.so") } } create("armv7") { ndk.with { - abiFilters += "armeabi-v7a" + abiFilters.addAll("armeabi-v7a") File curDir = file('./') curDir = file(curDir.absolutePath) String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\armeabi-v7a\\" - ldLibs += libsDir + "libopencv_java3.so" + ldLibs.addAll(libsDir + "libopencv_java3.so") } } create("x86") { ndk.with { - abiFilters += "x86" + abiFilters.addAll("x86") File curDir = file('./') curDir = file(curDir.absolutePath) String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\x86\\" - ldLibs += libsDir + "libopencv_java3.so" + ldLibs.addAll(libsDir + "libopencv_java3.so") } } create("mips") { ndk.with { - abiFilters += "mips" + abiFilters.addAll("mips") File curDir = file('./') curDir = file(curDir.absolutePath) String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\mips\\" - ldLibs += libsDir + "libopencv_java3.so" + ldLibs.addAll(libsDir + "libopencv_java3.so") } } create("fat") { diff --git a/build.gradle b/build.gradle index 4864901..f6de81c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle-experimental:0.2.0' + classpath 'com.android.tools.build:gradle-experimental:0.9.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 402b043..7ff406f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Aug 24 13:56:07 BRT 2015 +#Fri Dec 22 19:49:15 CET 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/libraries/opencv/build.gradle b/libraries/opencv/build.gradle index 1b2adf3..b06bf4d 100644 --- a/libraries/opencv/build.gradle +++ b/libraries/opencv/build.gradle @@ -3,16 +3,17 @@ apply plugin: 'com.android.model.library' buildscript { repositories { mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle-experimental:0.2.0' + classpath 'com.android.tools.build:gradle-experimental:0.9.3' } } model { android { compileSdkVersion = 22 - buildToolsVersion = "23.0.0" + buildToolsVersion = "25.0.3" defaultConfig.with { minSdkVersion.apiLevel = 8 From 63d90d78c6ef13a8df225a02209c8c403f86bee6 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Wed, 27 Dec 2017 07:29:03 +0100 Subject: [PATCH 3/3] additional to solve previous error (cherry picked from commit d6ae18bd81be8808c3f2a2ed913456ade8fd6cef) --- app/build.gradle | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 68f5176..6430cc4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,10 +26,11 @@ model { */ android.ndk { moduleName = "ndklibrarysample" - CFlags.add("-std=c++11") - CFlags.add("-fexceptions") - CFlags.add("-frtti") - CFlags.add("-I${file("~/git/openCV/openCV-3.3.1/sdk/native/jni/include")}".toString()) // download it here https://www.opencv.org/releases.html + cppFlags.add("-std=c++11") + cppFlags.add("-fexceptions") + cppFlags.add("-frtti") + cppFlags.add("-I${file("/Users/hannes/git/openCV/openCV-3.3.1/sdk/native/jni/include/")}".toString()) // download it here https://www.opencv.org/releases.html + cppFlags.add("-I${file("/Users/hannes/Development/my-android-toolchain/sysroot/usr/include/")}".toString()) ldLibs.addAll("android", "EGL", "GLESv2", "dl", "log", "z") stl = "gnustl_static" }