paamand / gdal4android Goto Github PK
View Code? Open in Web Editor NEWBuilding GDAL as a *.AAR for android
License: Other
Building GDAL as a *.AAR for android
License: Other
Hi, I need to build GDAL 3.1 aar file. With your instructions i am able to create v2 of Gdal.
Could you please help me to create GDAL v3.1 aar file
Can you directly generate Android library files for everyone to download?
After some time I manager to successfully run ./gradlew installFromSource
following the instructions explained on the README to the letter.
Now, I am attempting to build it using ./gradlew build
, for which I encountered some issues. First, I found that I had to run that command with sudo
. After that, it proceeded normally until it threw an error that reads:
FAILURE: Build failed with an exception.
- Where:
Build file '/home/graycygnus/AndroidStudioProjects/GDAL/gdal/build.gradle' line: 1- What went wrong:
A problem occurred evaluating project ':gdal'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/LibraryPlugin : Unsupported major.minor version 52.0
Digging around StackOverflow and other places, I found that such error is thrown when you attempt to run with an older JRE. The solution most commonly found is to install Java8 and use it to run the build (setting the JAVA_HOME to the newer java8).
However, I am on Ubuntu 14.04 LTS, so getting Java 8 is not so trivial (it seems that for 14.04 you have to get it from an alternative ppa repo, and get the Oracle version as well)...
So... before I attempt to install and get Java 8 and try building with it, I want to ask if you see something that perhaps I'm missing, or that you suggest I try before going for the install Java8 option?
Some info (if more is needed, I'll provide it gladly):
Ubuntu 14.04
When selection Help > About
I get:
Android Studio 3.3.1
Build #AI-182.5107.16.33.5264788, built on January 28, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-137-generic
I am curious about the "JRE: 1.8.0" as it would suggest that it already uses Java8. But, then why complain for UnsupportedClassVersion
when I run ./gradlew build
on my terminal? Perhaps the issue has something to do with that? I have selected the "use embedded JDK" which path is /opt/android-studio/jre
, and therefore my JAVA_HOME is set to that path.
I successfully ran ./gradlew installFromSource
.
Now I am attempting to run ./gradlew build
but it quickly fails, and indicates the following trace:
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:7: error: package org.gdal.gdal does not exist
import org.gdal.gdal.gdal;
^
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:8: error: package org.gdal.osr does not exist
import org.gdal.osr.CoordinateTransformation;
^
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:9: error: package org.gdal.osr does not exist
import org.gdal.osr.SpatialReference;
^
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:10: error: package org.gdal.osr does not exist
import org.gdal.osr.osr;
^
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:19: error: cannot find symbol
String versionNfo = gdal.VersionInfo();
^
symbol: variable gdal
location: class MainActivity
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:33: error: cannot find symbol
SpatialReference utmSpatialReference = new SpatialReference();
^
symbol: class SpatialReference
location: class MainActivity
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:33: error: cannot find symbol
SpatialReference utmSpatialReference = new SpatialReference();
^
symbol: class SpatialReference
location: class MainActivity
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:35: error: cannot find symbol
CoordinateTransformation trsform = osr.CreateCoordinateTransformation(
^
symbol: class CoordinateTransformation
location: class MainActivity
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:36: error: cannot find symbol
new SpatialReference(EPSG4326), //LatLng
^
symbol: class SpatialReference
location: class MainActivity
/home/graycygnus/gdalAndroidAARTest/GDAL/gdaltest/src/main/java/eu/paamand/gdaltest/MainActivity.java:35: error: cannot find symbol
CoordinateTransformation trsform = osr.CreateCoordinateTransformation(
^
symbol: variable osr
location: class MainActivity
10 errors
Up untill now everything has been smoothly, so I don't know if I'm missing some step or missing a file or something. If more details are needed, I'll gladly provide them :)
configure: error: in `/home/ros/GDAL/submodules/gdal/gdal':
configure: error: C compiler cannot create executables
libtool: error: error: cannot install 'libgdalalljni.la' to a directory not ending in /home/ros/GDAL/gdal/../submodules/build/arm64-v8a/lib
configure: error: in /home/ros/GDAL/submodules/proj4': configure: error: C compiler cannot create executables See
config.log' for more details
clang: error: no such file or directory: './.libs/libproj.so'
make[2]: *** [Makefile:955: proj] Error 1
make[2]: Leaving directory '/home/ros/GDAL/submodules/proj4/src'
make[1]: *** [Makefile:780: all] Error 2
make[1]: Leaving directory '/home/ros/GDAL/submodules/proj4/src'
make: *** [Makefile:451: all-recursive] Error 1
clang: error: no such file or directory: './.libs/libproj.so'
make: *** [Makefile:955: proj] Error 1
cp: cannot stat '/home/ros/GDAL/gdal/../submodules/build/x86/lib/libproj.so': No such file or directory
Simply trying to build project in Android Studio gives the message:
org.gradle.api.ProjectConfigurationException: A probelm occured configuring project ':gdal'.
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.api.GradleException: executing external native build for cmake ./gdal/CMakeLists.txt
Similarly to issue #1, I am getting syncing errors as well.
I tried changing
add_library( gdalwrap SHARED src/main/cpp/gdal_wrap.cpp )
to
add_library( gdalwrap SHARED ../submodules/gdal/gdal/swig/python/extensions/gdal_wrap.cpp
but it made no difference.
I want to update the latest version of GDAL 3.0 and PROJ4 6.0 but there was an error with sqlite3 lib.
And I did not find MBTiles driver in your AAR lib at here (#11 (comment))
You can update the Readme again. Please help me
Thank you so much
I build on Ubuntu 18.04
~/piceadev/android/GDAL/gdal% ./../submodules/install.sh ~/piceadev/android/sdk/ndk-bundle 24 2>&1 | tee install.log
install.log
See below for summary of errors. I tried symlinking /usr/include/rpc into /usr/include/ogdi, which solved the rpc/rpc.h not found error, but then there were a bunch of unknown type errors: quad_t, u_quad_t
% uname -a Linux hostname 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Results in the following errors:
~/piceadev/android/GDAL/gdal% grep error: install.log
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
libtool: error: 'lib*jni.la' is not a valid libtool archive
clang: error: no such file or directory: './.libs/libproj.so'
clang: error: no such file or directory: './.libs/libproj.so'
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
libtool: error: 'lib*jni.la' is not a valid libtool archive
clang: error: no such file or directory: './.libs/libproj.so'
clang: error: no such file or directory: './.libs/libproj.so'
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
libtool: error: 'lib*jni.la' is not a valid libtool archive
clang: error: no such file or directory: './.libs/libproj.so'
clang: error: no such file or directory: './.libs/libproj.so'
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
libtool: error: 'lib*jni.la' is not a valid libtool archive
clang: error: no such file or directory: './.libs/libproj.so'
clang: error: no such file or directory: './.libs/libproj.so'
With lines of context:
~/piceadev/android/GDAL/gdal% grep -n -C 3 error: install.log
12025-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -stdlib=libc++ -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
12026-In file included from ogrogdidriver.cpp:30:
12027-In file included from ./ogrogdi.h:40:
12028:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
12029-#include <rpc/rpc.h>
12030- ^~~~~~~~~~~
12031-1 error generated.
--
12587-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -stdlib=libc++ -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
12588-In file included from ogrogdidriver.cpp:30:
12589-In file included from ./ogrogdi.h:40:
12590:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
12591-#include <rpc/rpc.h>
12592- ^~~~~~~~~~~
12593-1 error generated.
--
12618-make: *** [../SWIGmake.base:10: gdal_wrap.cpp] Error 127
12619-Usage: /home/scott/piceadev/android/GDAL/gdal/../submodules/gdal/gdal/libtool [OPTION]... [MODE-ARG]...
12620-Try 'libtool --help' for more information.
12621:libtool: error: 'lib*jni.la' is not a valid libtool archive
12622-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86/lib/lib*jni.so': No such file or directory
12623-Running aclocal
12624-Running autoheader
--
13929-libtool: link: ( cd ".libs" && rm -f "libproj.la" && ln -s "../libproj.la" "libproj.la" )
13930-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
13931-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86/lib
13932:clang: error: no such file or directory: './.libs/libproj.so'
13933-make[2]: *** [Makefile:954: proj] Error 1
13934-make[2]: Leaving directory '/home/scott/piceadev/android/GDAL/submodules/proj4/src'
13935-make[1]: *** [Makefile:779: all] Error 2
--
13937-make: *** [Makefile:450: all-recursive] Error 1
13938-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
13939-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86/lib
13940:clang: error: no such file or directory: './.libs/libproj.so'
13941-make: *** [Makefile:954: proj] Error 1
13942-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86/lib/libproj.so': No such file or directory
13943-######### x86_64 : x86_64-linux-android ##########
--
26214-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -stdlib=libc++ -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
26215-In file included from ogrogdidriver.cpp:30:
26216-In file included from ./ogrogdi.h:40:
26217:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
26218-#include <rpc/rpc.h>
26219- ^~~~~~~~~~~
26220-1 error generated.
--
26780-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -stdlib=libc++ -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
26781-In file included from ogrogdidriver.cpp:30:
26782-In file included from ./ogrogdi.h:40:
26783:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
26784-#include <rpc/rpc.h>
26785- ^~~~~~~~~~~
26786-1 error generated.
--
26811-make: *** [../SWIGmake.base:10: gdal_wrap.cpp] Error 127
26812-Usage: /home/scott/piceadev/android/GDAL/gdal/../submodules/gdal/gdal/libtool [OPTION]... [MODE-ARG]...
26813-Try 'libtool --help' for more information.
26814:libtool: error: 'lib*jni.la' is not a valid libtool archive
26815-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86_64/lib/lib*jni.so': No such file or directory
26816-Running aclocal
26817-Running autoheader
--
28125-libtool: link: ( cd ".libs" && rm -f "libproj.la" && ln -s "../libproj.la" "libproj.la" )
28126-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
28127-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86_64/lib
28128:clang: error: no such file or directory: './.libs/libproj.so'
28129-make[2]: *** [Makefile:954: proj] Error 1
28130-make[2]: Leaving directory '/home/scott/piceadev/android/GDAL/submodules/proj4/src'
28131-make[1]: *** [Makefile:779: all] Error 2
--
28133-make: *** [Makefile:450: all-recursive] Error 1
28134-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
28135-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86_64/lib
28136:clang: error: no such file or directory: './.libs/libproj.so'
28137-make: *** [Makefile:954: proj] Error 1
28138-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/x86_64/lib/libproj.so': No such file or directory
28139-######### armeabi-v7a : armv7a-linux-androideabi ##########
--
40132-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -mthumb -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
40133-In file included from ogrogdidriver.cpp:30:
40134-In file included from ./ogrogdi.h:40:
40135:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
40136-#include <rpc/rpc.h>
40137- ^~~~~~~~~~~
40138-1 error generated.
--
40694-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -mthumb -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
40695-In file included from ogrogdidriver.cpp:30:
40696-In file included from ./ogrogdi.h:40:
40697:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
40698-#include <rpc/rpc.h>
40699- ^~~~~~~~~~~
40700-1 error generated.
--
40725-make: *** [../SWIGmake.base:10: gdal_wrap.cpp] Error 127
40726-Usage: /home/scott/piceadev/android/GDAL/gdal/../submodules/gdal/gdal/libtool [OPTION]... [MODE-ARG]...
40727-Try 'libtool --help' for more information.
40728:libtool: error: 'lib*jni.la' is not a valid libtool archive
40729-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/armeabi-v7a/lib/lib*jni.so': No such file or directory
40730-Running aclocal
40731-Running autoheader
--
42036-libtool: link: ( cd ".libs" && rm -f "libproj.la" && ln -s "../libproj.la" "libproj.la" )
42037-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -mthumb -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
42038-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -mthumb -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/armeabi-v7a/lib
42039:clang: error: no such file or directory: './.libs/libproj.so'
42040-make[2]: *** [Makefile:954: proj] Error 1
42041-make[2]: Leaving directory '/home/scott/piceadev/android/GDAL/submodules/proj4/src'
42042-make[1]: *** [Makefile:779: all] Error 2
--
42044-make: *** [Makefile:450: all-recursive] Error 1
42045-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -mthumb -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
42046-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -mthumb -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/armeabi-v7a/lib
42047:clang: error: no such file or directory: './.libs/libproj.so'
42048-make: *** [Makefile:954: proj] Error 1
42049-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/armeabi-v7a/lib/libproj.so': No such file or directory
42050-######### arm64-v8a : aarch64-linux-android ##########
--
54208-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -stdlib=libc++ -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
54209-In file included from ogrogdidriver.cpp:30:
54210-In file included from ./ogrogdi.h:40:
54211:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
54212-#include <rpc/rpc.h>
54213- ^~~~~~~~~~~
54214-1 error generated.
--
54770-/bin/bash /home/scott/piceadev/android/GDAL/submodules/gdal/gdal/libtool --mode=compile --silent --tag=CXX /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++ -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gcore -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/alg -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/ogr/ogrsf_frmts -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/gnm -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/apps -stdlib=libc++ -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough -I/usr/include/ogdi -DGNM_ENABLED -I/home/scott/piceadev/android/GDAL/submodules/gdal/gdal/port -DGDAL_COMPILATION -c -o ../o/ogrogdidriver.lo ogrogdidriver.cpp
54771-In file included from ogrogdidriver.cpp:30:
54772-In file included from ./ogrogdi.h:40:
54773:/usr/include/ogdi/ecs.h:9:10: fatal error: 'rpc/rpc.h' file not found
54774-#include <rpc/rpc.h>
54775- ^~~~~~~~~~~
54776-1 error generated.
--
54801-make: *** [../SWIGmake.base:10: gdal_wrap.cpp] Error 127
54802-Usage: /home/scott/piceadev/android/GDAL/gdal/../submodules/gdal/gdal/libtool [OPTION]... [MODE-ARG]...
54803-Try 'libtool --help' for more information.
54804:libtool: error: 'lib*jni.la' is not a valid libtool archive
54805-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/arm64-v8a/lib/lib*jni.so': No such file or directory
54806-Running aclocal
54807-Running autoheader
--
56115-libtool: link: ( cd ".libs" && rm -f "libproj.la" && ln -s "../libproj.la" "libproj.la" )
56116-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
56117-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/arm64-v8a/lib
56118:clang: error: no such file or directory: './.libs/libproj.so'
56119-make[2]: *** [Makefile:954: proj] Error 1
56120-make[2]: Leaving directory '/home/scott/piceadev/android/GDAL/submodules/proj4/src'
56121-make[1]: *** [Makefile:779: all] Error 2
--
56123-make: *** [Makefile:450: all-recursive] Error 1
56124-/bin/bash ../libtool --tag=CC --mode=link /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o proj proj.o gen_cheb.o p_series.o libproj.la -lm
56125-libtool: link: /home/scott/piceadev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -DHAVE_C99_MATH=1 -o .libs/proj proj.o gen_cheb.o p_series.o ./.libs/libproj.so -lm -L/home/scott/piceadev/android/GDAL/gdal/../submodules/build/arm64-v8a/lib
56126:clang: error: no such file or directory: './.libs/libproj.so'
56127-make: *** [Makefile:954: proj] Error 1
56128-cp: cannot stat '/home/scott/piceadev/android/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.so': No such file or directory
56129-mkdir: cannot create directory ‘/home/scott/piceadev/android/GDAL/gdal/src/main/cpp’: File exists
Hello, can you provide me with a compiled 64-bit GDAL AAR library? thank you!
Can you remake with android-studio-2021.2.1.15.
Hello, i would like to know under what license the binaries found here has been released under.
Thank you
As the title said, here is the log info:
CMake Error at CMakeLists.txt:8 (add_library):
Cannot find source file:
src/main/cpp/gdal_wrap.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
And I checked the directory, the src/main only contains one file AndroidManifest.xml.
I am trying to create a shapefile. But when I do
Driver driver = ogr.GetDriverByName("ESRI Shapefile");
It return null. Then I tried
gdal.GetDriverCount()
And it returns 0.
How to include ESRI Shapefile driver?
I compiled the AAR file as shown in the README. To test everything i wanted to transform a coordinate
Driver memDriver = gdal.GetDriverByName("MEM");
Dataset ds1 = memDriver.Create("mem", 100, 100);
ds1.SetGeoTransform(new double[]{2, 0.01, 0, 49, 0, -0.01});
SpatialReference sr1 = new SpatialReference();
sr1.ImportFromEPSG(4326);
But the line sr1.ImportFromEPSG(4326)
throws an exception:
2019-04-25 10:45:47.274 3506-3506/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.gdaltest, PID: 3506
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gdaltest/com.example.gdaltest.MainActivity}: java.lang.RuntimeException: OGR Error: General Error
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.RuntimeException: OGR Error: General Error
at org.gdal.osr.osrJNI.SpatialReference_ImportFromEPSG(Native Method)
at org.gdal.osr.SpatialReference.ImportFromEPSG(SpatialReference.java:569)
at com.example.gdaltest.MainActivity.gdalTransform(MainActivity.java:54)
at com.example.gdaltest.MainActivity.onCreate(MainActivity.java:30)
at android.app.Activity.performCreate(Activity.java:7144)
at android.app.Activity.performCreate(Activity.java:7135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Do I have to import more into my Android-Project?
Hi @paamand do you have any success compiling with PDF support? (poppler/podofo/pdfium)?
Hello,
i'm trying to compile this project but I have an issue :
CMake Error at CMakeLists.txt:10 (add_library): |
-- | --
src/main/cpp/gdal_wrap.cpp |
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp |
.hxx .in .txx |
CMake Error: CMake can not determine linker language for target: gdalwrap
does anyone have an idea to fix this problem?
Thanks !
I'm trying to import GDAL as a module to my project. Here's my code:
val testDS: Dataset = gdal.Open(myApp.getSelectedFile())
Log.e("GDAL Output:", gdal.GDALInfo(testDS, null))
It's giving the following output errors:
Native library load failed
java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
No implementation found for long org.gdal.gdal.gdalJNI.Open__SWIG_1(java.lang.String) (tried Java_org_gdal_gdal_gdalJNI_Open_1_1SWIG_11 and Java_org_gdal_gdal_gdalJNI_Open_1_1SWIG_11__Ljava_lang_String_2)
Is there something I'm missing?
.
.
.
gpssat/GDAL/submodules/gdal/gdal/port/cplstring.lo /home/gpssat/GDAL/submodules/gdal/gdal/port/cplstringlist.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/BitMask.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/BitStuffer2.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/Huffman.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/Lerc.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/Lerc2.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/Lerc_c_api_impl.lo /home/gpssat/GDAL/submodules/gdal/gdal/third_party/o/RLE.lo
-rpath /home/gpssat/GDAL/gdal/../submodules/build/arm64-v8a/lib
-no-undefined
-version-info 24:0:4
/home/gpssat/GDAL/submodules/gdal/gdal/libtool: line 1734: /home/gpssat/developer/sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar: No such file or directory
make[1]: *** [GNUmakefile:63: libgdal.la] Erro 127
make[1]: Saindo do diretório '/home/gpssat/GDAL/submodules/gdal/gdal'
make: *** [GNUmakefile:74: check-lib] Erro 2
cp: não foi possível obter estado de '/home/gpssat/GDAL/gdal/../submodules/build/arm64-v8a/lib/libgdal.so': Arquivo ou diretório inexistente
rm -f libgdalalljni.la
rm -f .lo
rm -f .libs/.so
rm -f .libs/*.dylib
rm -f .so
rm -f .dylib
ant clean
/bin/bash: ant: comando não encontrado
make: *** [GNUmakefile:47: clean] Erro 127
mkdir -p org/gdal/gdal
mkdir -p org/gdal/gdalconst
mkdir -p org/gdal/ogr
mkdir -p org/gdal/osr
mkdir -p org/gdal/gnm
swig -Wall -I../include -I../include/java -I../include/java/docs -outdir "org/gdal/gdal" -package "org.gdal.gdal" -DSWIGANDROID -I/home/gpssat/GDAL/submodules/gdal/gdal -c++ -java -o gdal_wrap.cpp ../include/gdal.i
/bin/bash: swig: comando não encontrado
make: *** [../SWIGmake.base:10: gdal_wrap.cpp] Erro 127
Usage: /home/gpssat/GDAL/gdal/../submodules/gdal/gdal/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool: error: 'libjni.la' is not a valid libtool archive
cp: não foi possível obter estado de '/home/gpssat/GDAL/gdal/../submodules/build/arm64-v8a/lib/libjni.so': Arquivo ou diretório inexistente
Running aclocal
./autogen.sh: 29: aclocal: not found
Something went wrong, giving up!
./../submodules/install.sh: linha 79: ./configure: Arquivo ou diretório inexistente
make: *** Sem regra para processar o alvo 'clean'. Pare.
make: *** Nenhum alvo indicado e nenhum arquivo make encontrado. Pare.
make: *** Sem regra para processar o alvo 'install'. Pare.
cp: não foi possível obter estado de '/home/gpssat/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.so': Arquivo ou diretório inexistente
mkdir: não foi possível criar o diretório “/home/gpssat/GDAL/gdal/src/main/cpp”: Arquivo existe
cp: não foi possível obter estado de '/home/gpssat/GDAL/gdal/../submodules/build/arm64-v8a/include': Arquivo ou diretório inexistente
mkdir: não foi possível criar o diretório “/home/gpssat/GDAL/gdal/libs”: Arquivo existe
cp: não foi possível obter estado de 'gdal.jar': Arquivo ou diretório inexistente
cp: não foi possível obter estado de '_wrap.cpp': Arquivo ou diretório inexistente
cp: não foi possível obter estado de '_wrap.c': Arquivo ou diretório inexistente
Google Play will require 64-bit support starting August 1, 2019:
Starting August 1, 2019:
All new apps and app updates that include native code are required to provide 64-bit versions in addition to 32-bit versions when publishing to Google Play.
Source: https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html
gdal.AllRegister()
val test = gdal.Open("/something.pdf")
returns null, which crashes my program.
Opening a GeoTiff works perfectly and gdal.GDALInfo(test, null)
returns a string with the correct information.
This is because the default compilation does not support PDFs. You have to add either Poppler, PDFium, or PoDoFo as a dependency.
I tried adding Poppler as a compile flag in the submodules/install.sh, but it still gave the gdal.GDALOpen() must not be null
error for pdfs.
Line 18 of install.sh:
CC="arm-linux-androideabi-clang" CXX="arm-linux-androideabi-clang++" CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lstdc++" ./configure --host=arm-linux-androideabi --with-libz=internal --prefix=$BUILDDIR/arm --with-threads --with-poppler
When I compiled GDAL for desktop Unix including the --with-poppler
flag, it could read the same PDF without any problems and GDALInfo returned the correct data.
It might be helpful to rename this repository to something more specific, like "GDAL-Android-Bindings"
thank you for putting this library together! I've been unable to compile gdal from the steps outlined in the readme over several tries. I am including --with-lib=/usr/local/Cellar/poppler/0.90.1/
in my configure script & have changed the HOST_TAG
value to darwin-x86_64
as I am compiling on MacOS, but otherwise the configuration is mostly the same. I'm getting the following error in the final stages of the run (I've also tried removing the --with-lib
flag & get the same error) --
basic_test.o: In function `(anonymous namespace)::dumy_dummy_Test::dumy_dummy_Test()':
basic_test.cpp:(.text+0x124): undefined reference to `testing::Test::Test()'
basic_test.o: In function `(anonymous namespace)::dumy_dummy_Test::~dumy_dummy_Test()':
basic_test.cpp:(.text+0x154): undefined reference to `testing::Test::~Test()'
basic_test.o: In function `(anonymous namespace)::dumy_dummy_Test::TestBody()':
basic_test.cpp:(.text+0x28c): undefined reference to `testing::Message::Message()'
basic_test.cpp:(.text+0x2bc): undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
basic_test.cpp:(.text+0x2cc): undefined reference to `testing::internal::AssertHelper::operator=(testing::Message const&) const'
basic_test.cpp:(.text+0x2d8): undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
basic_test.cpp:(.text+0x308): undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
basic_test.o: In function `__cxx_global_var_init':
basic_test.cpp:(.text.startup+0x48): undefined reference to `testing::internal::GetTestTypeId()'
basic_test.cpp:(.text.startup+0xb0): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
basic_test.o: In function `testing::AssertionResult testing::internal::CmpHelperNE<std::__ndk1::unique_ptr<PJconsts, PJconsts* (*)(PJconsts*)>, decltype(nullptr)>(char const*, char const*, std::__ndk1::unique_ptr<PJconsts, PJconsts* (*)(PJconsts*)> const&, decltype(nullptr) const&)':
basic_test.cpp:(.text._ZN7testing8internal11CmpHelperNEINSt6__ndk110unique_ptrI8PJconstsPFPS4_S5_EEEDnEENS_15AssertionResultEPKcSB_RKT_RKT0_[_ZN7testing8internal11CmpHelperNEINSt6__ndk110unique_ptrI8PJconstsPFPS4_S5_EEEDnEENS_15AssertionResultEPKcSB_RKT_RKT0_]+0x40): undefined reference to `testing::AssertionSuccess()'
basic_test.o: In function `testing::AssertionResult testing::internal::CmpHelperOpFailure<std::__ndk1::unique_ptr<PJconsts, PJconsts* (*)(PJconsts*)>, decltype(nullptr)>(char const*, char const*, std::__ndk1::unique_ptr<PJconsts, PJconsts* (*)(PJconsts*)> const&, decltype(nullptr) const&, char const*)':
basic_test.cpp:(.text._ZN7testing8internal18CmpHelperOpFailureINSt6__ndk110unique_ptrI8PJconstsPFPS4_S5_EEEDnEENS_15AssertionResultEPKcSB_RKT_RKT0_SB_[_ZN7testing8internal18CmpHelperOpFailureINSt6__ndk110unique_ptrI8PJconstsPFPS4_S5_EEEDnEENS_15AssertionResultEPKcSB_RKT_RKT0_SB_]+0x40): undefined reference to `testing::AssertionFailure()'
basic_test.cpp:(.text._ZN7testing8internal18CmpHelperOpFailureINSt6__ndk110unique_ptrI8PJconstsPFPS4_S5_EEEDnEENS_15AssertionResultEPKcSB_RKT_RKT0_SB_[_ZN7testing8internal18CmpHelperOpFailureINSt6__ndk110unique_ptrI8PJconstsPFPS4_S5_EEEDnEENS_15AssertionResultEPKcSB_RKT_RKT0_SB_]+0x14c): undefined reference to `testing::AssertionResult::AssertionResult(testing::AssertionResult const&)'
basic_test.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [12]>(char const (&) [12])':
basic_test.cpp:(.text._ZN7testing15AssertionResultlsIA12_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA12_cEERS0_RKT_]+0x28): undefined reference to `testing::Message::Message()'
basic_test.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char const*>(char const* const&)':
basic_test.cpp:(.text._ZN7testing15AssertionResultlsIPKcEERS0_RKT_[_ZN7testing15AssertionResultlsIPKcEERS0_RKT_]+0x28): undefined reference to `testing::Message::Message()'
basic_test.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [3]>(char const (&) [3])':
basic_test.cpp:(.text._ZN7testing15AssertionResultlsIA3_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA3_cEERS0_RKT_]+0x28): undefined reference to `testing::Message::Message()'
basic_test.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)':
basic_test.cpp:(.text._ZN7testing15AssertionResultlsINSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_[_ZN7testing15AssertionResultlsINSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_]+0x28): undefined reference to `testing::Message::Message()'
basic_test.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [5]>(char const (&) [5])':
basic_test.cpp:(.text._ZN7testing15AssertionResultlsIA5_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA5_cEERS0_RKT_]+0x28): undefined reference to `testing::Message::Message()'
basic_test.o: In function `testing::AssertionResult::AppendMessage(testing::Message const&)':
basic_test.cpp:(.text._ZN7testing15AssertionResult13AppendMessageERKNS_7MessageE[_ZN7testing15AssertionResult13AppendMessageERKNS_7MessageE]+0xa0): undefined reference to `testing::Message::GetString() const'
basic_test.o: In function `testing::internal::scoped_ptr<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >::reset(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*)':
basic_test.cpp:(.text._ZN7testing8internal10scoped_ptrINSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE5resetEPS8_[_ZN7testing8internal10scoped_ptrINSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE5resetEPS8_]+0x3c): undefined reference to `testing::internal::IsTrue(bool)'
basic_test.o: In function `testing::internal::scoped_ptr<std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >::reset(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*)':
basic_test.cpp:(.text._ZN7testing8internal10scoped_ptrINSt6__ndk118basic_stringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE5resetEPS8_[_ZN7testing8internal10scoped_ptrINSt6__ndk118basic_stringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE5resetEPS8_]+0x3c): undefined reference to `testing::internal::IsTrue(bool)'
basic_test.o:(.data.rel.ro+0x60): undefined reference to `testing::Test::SetUp()'
basic_test.o:(.data.rel.ro+0x68): undefined reference to `testing::Test::TearDown()'
basic_test.o:(.data.rel.ro+0x90): undefined reference to `typeinfo for testing::Test'
main.o: In function `main':
main.cpp:(.text+0x24): undefined reference to `testing::InitGoogleTest(int*, char**)'
main.o: In function `RUN_ALL_TESTS()':
main.cpp:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0x8): undefined reference to `testing::UnitTest::GetInstance()'
main.cpp:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0xc): undefined reference to `testing::UnitTest::Run()'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [basic_test] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
.././install-sh -c -d '/Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib'
/bin/sh ../libtool --mode=install /usr/bin/install -c libproj.la '/Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib'
libtool: install: /usr/bin/install -c .libs/libproj.so /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.so
libtool: install: /usr/bin/install -c .libs/libproj.lai /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.la
libtool: install: /usr/bin/install -c .libs/libproj.a /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.a
libtool: install: chmod 644 /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.a
libtool: install: ranlib /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/lib/libproj.a the table of contents is empty (no object file members in the library define global symbols)
.././install-sh -c -d '/Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin'
/bin/sh ../libtool --mode=install /usr/bin/install -c proj nad2bin geod cs2cs gie cct '/Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin'
libtool: install: /usr/bin/install -c .libs/proj /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/proj
libtool: install: /usr/bin/install -c .libs/nad2bin /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/nad2bin
libtool: install: /usr/bin/install -c .libs/geod /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/geod
libtool: install: /usr/bin/install -c .libs/cs2cs /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/cs2cs
libtool: install: /usr/bin/install -c .libs/gie /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/gie
libtool: install: /usr/bin/install -c .libs/cct /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/cct
rm -f /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/invproj
(cd /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin; ln -s proj invproj)
rm -f /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin/invgeod
(cd /Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/bin; ln -s geod invgeod)
.././install-sh -c -d '/Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/include'
/usr/bin/install -c -m 644 proj.h proj_api.h geodesic.h org_proj4_PJ.h '/Users/sashaheinen/workspace/GDAL/gdal/../submodules/build/arm64-v8a/include'
mkdir: /Users/sashaheinen/workspace/GDAL/gdal/src/main/cpp: File exists
mkdir: /Users/sashaheinen/workspace/GDAL/gdal/libs: File exists
cp: gdal.jar: No such file or directory
I can run ./gradlew build
after this to generate aars with the bindings, but they do not include the gdal.jar
file. I've tried pulling the gdal.jar
file out of the sample aars you've provided in other issues and putting it into the compiled .aar
files in my gdal/build/outputs/aar
directory, which works, but I really need it to compile with poppler. given that it seems to be broken in the same place independent of the config, do you have any guidance for getting this compilation working?
Been trying to build for the past two days... I get to the point of running this:
and I get the errors about missing gdal.jar file (see attached)
What am I missing?
gdal-install.log
Can you please create a Readme for how to get started with this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.