Android使用Google map的地图服务的开发 INSTALL_FAILED_MISSING_SHARED_LIBRARY 问题

本文针对Android地图服务开发过程中常见的两类错误提供了详细的解决方案。包括配置AndroidManifest.xml、选择正确的Build Target、设置模拟器和真实设备的环境等步骤。

地图服务开发中遇到此类错误大体分为以下两种情况解决:(论坛里大多都是属于第一种情况的答案,但是遇到第二种情

况论坛的解决基本无效)。


情况一:如果你用模拟器调试程序

  首先检查AndroidManifest.xml,确保已经写了<uses-library android:name=”com.google.android.maps” />
 其次确保你新建工程的时候 Build Target 选择的TargetName不是Android 而是其版本对应的Google APIs。
 最后新建模拟器,target同样选择Google APIs。
 这样此问题基本解决。你可以正常运行于模拟器上了。如果运行之后地图无法显示,而是现实灰色表格。那么说明你的

android:apiKey 不对。重新注册apiKey(具体方法看api或者去论坛,这里不再赘述)。

 

情况二:如果模拟器运行正常而真机调试时候出现类似错误。
 那是因为你的真机中system/framework下缺少文件com.google.android.maps.jar。
 解决办法:

   1、进入你设备的shell
    adb -d shell  (记着参数 -d)
   2、给system挂在读写权限
    这里不同的机器稍有不同,大家可以如下看看那中情况合适你的机器:
   mount -o rw -t yaffs2 /dev/block/mtdblock3 /system
或者
   mount -o remount,rw /dev/root /
对于我的机器:
我的是用了cm的系统的。这么做:
mount -o remount,rw  /dev/block/mtdblock3 /system

3、从emulator的system/framework文件夹下导出com.google.android.maps.jar ,可以直接通过ddms导出、或者通过adb

命令导出:
    adb -d push com.google.android.maps.jar /system/framework/

或者

    adb push com.google.android.maps.jar /system/framework/com.google.android.maps.jar

adb push com.google.android.gtalkservice.jar /system/framework/com.google.android.gtalkservice.jar
4、给这个文件增加权限:
这里两种做法:
    (1)把真机中/etc/permissions/platform.xml文件取出来编辑:

<permissions>
</permissions>
中末尾处增加:
<library name="com.google.android.maps" file="/system/framework/com.google.android.maps.jar"/>

然后再把这个platform.xml文件push回真机的/etc/permissions文件夹中.
   (2)对于2.2以后的版本亦可这么做:你可以直接直接pull出你emulator的 

/etc/permissions/com.google.android.maps.xml 然后push进你真机的 /etc/permissions

5、重启手机,此时你就可以调试你的android服务了。如果不行再重启一次就好。

找了很久,,资源都是分开的 这次我把他汇总,打包,方便下载了 不用一个一个的找了下了 很多使用安卓的朋友应该都遇到过安装某些软件出现”应用未安装“,用电脑手机助手进行安装时会出现没有该软件的共享库或已失效,这个问题大概困扰了我3天时间,终于在我的坚持下找到了解决方法,希望出现过这样问题的朋友严格安装我下面的步骤操作即可解决以上问题! 第一步:使用第三方工具中的ROOT获取工具,进行获取ROOT权限。 第二步:下载ROOT EXPLORER 具有最高权限的文件管理工具,安装并打开(打开时出现是否允许此软件使用最高权限,允许)。 第三步:下载以下三个文件。 com.google.android.maps.jar com.google.android.maps.xml NetworkLocation.apk 第四步:使用ROOT EXPLORER 文件工具将三个文件以下面的说明操作。 com.google.android.maps.jar 拷贝到根目录的 system/framework/ 文件夹下面。 然后将此文件的权限设为 root 权限,然后在设置访问权限对话框上选项上对话框选项有9个可打钩的方格,把左边三个的全部勾选,中间的三个的第一个勾上即可。 com.google.android.maps.xml 拷贝到根目录的 system/etc/permissions/ 文件夹下面。 同上面的设置权限的方法一样。 NetworkLocation.apk 拷贝到根目录的 data/app_s/ 文件夹下面。 (如果找不到 app_s这个文件夹,可以新建一个 app_s文件夹,然后在将其拷贝进去)!将此文件的权限设置为 system 然后在设置访问权限对话框上选项上对话框选项有9个可打钩的方格,将左边三个全部勾上,中间的第一个和第二个勾上,右边全部勾上即可。然后重启手机,开始安装你以前安装失败的软件,然后你就会看到安装成功的兴奋了。这样你就永远不会在遇到软件未安装或没有该软件的共享库或已失效的情况了。
The C compiler identification is MSVC 19.44.35215.0 The CXX compiler identification is MSVC 19.44.35215.0 Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped Detecting C compile features Detecting C compile features - done Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped Detecting CXX compile features Detecting CXX compile features - done target changed from "" to "auto" CMake Warning at cmakeFindModules/OptimizeForArchitecture.cmake:170 (message): Your CPU (family 6, model 183) is not known. Auto-detection of optimization flags failed and will use the 65nm Core 2 CPU settings. Call Stack (most recent call first): cmakeFindModules/OptimizeForArchitecture.cmake:229 (AutodetectHostArchitecture) CMakeLists.txt:131 (OptimizeForArchitecture) Detected CPU: merom Performing Test check_c_compiler_flag__arch_SSE2 Performing Test check_c_compiler_flag__arch_SSE2 - Success Performing Test check_cxx_compiler_flag__arch_SSE2 Performing Test check_cxx_compiler_flag__arch_SSE2 - Success Checking for C++11 compiler Checking for C++11 compiler - available Found OpenMP_C: -openmp (found version "2.0") Found OpenMP_CXX: -openmp (found version "2.0") Found OpenMP: TRUE (found version "2.0") Eigen 3.4.0 found (include: E:/openmvg/openMVG/src/third_party/eigen) CoinUtils 2.10.13 found (include: E:/openmvg/openMVG/src/dependencies/osi_clp/CoinUtils/src) Clp 1.16.10 found (include: E:/openmvg/openMVG/src/dependencies/osi_clp/Clp/src) You are attempting to build without Osi. Please use cmake variable -DOSI_INCLUDE_DIR_HINTS:STRING="PATH" or OSI_INCLUDE_DIR_HINTS env. variable to a valid Osi path. Or install last Osi version. CMake Deprecation Warning at dependencies/osi_clp/CMakeLists.txt:6 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. Lemon found (include: E:/openmvg/openMVG/src/third_party/lemon/lemon) CMake Warning (dev) at F:/CMake/share/cmake-3.30/Modules/FetchContent.cmake:1373 (message): The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is not set. The policy's OLD behavior will be used. When using a URL download, the timestamps of extracted files should preferably be that of the time of extraction, otherwise code that depends on the extracted contents might not be rebuilt if the URL changes. The OLD behavior preserves the timestamps from the archive instead, but this is usually not what you want. Update your project to the NEW behavior or specify the DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this robustness issue. Call Stack (most recent call first): CMakeLists.txt:438 (FetchContent_Declare) This warning is for project developers. Use -Wno-dev to suppress it. Compiler: MSVC 19.44.35215.0 (C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe) Rerun SDK install version: 0.25.0 CMake Deprecation Warning at third_party/lemon/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Warning (dev) at third_party/lemon/CMakeLists.txt:13 (INCLUDE): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. Found PythonInterp: F:/Anaconda3/python.exe (found version "3.12.4") Could NOT find Wget (missing: WGET_EXECUTABLE) Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) Could NOT find Ghostscript (missing: GHOSTSCRIPT_EXECUTABLE) Could NOT find COIN (missing: COIN_INCLUDE_DIR COIN_CBC_LIBRARY COIN_CBC_SOLVER_LIBRARY COIN_CGL_LIBRARY COIN_CLP_LIBRARY COIN_COIN_UTILS_LIBRARY COIN_OSI_LIBRARY COIN_OSI_CBC_LIBRARY COIN_OSI_CLP_LIBRARY) Looking for sys/types.h Looking for sys/types.h - found Looking for stdint.h Looking for stdint.h - found Looking for stddef.h Looking for stddef.h - found Check size of long long Check size of long long - done CMake Deprecation Warning at third_party/jpeg/CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. Looking for stdlib.h Looking for stdlib.h - found CMake Deprecation Warning at third_party/png/CMakeLists.txt:9 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/ceres-solver/CMakeLists.txt:32 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/ceres-solver/CMakeLists.txt:33 (cmake_policy): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. =============================================================== Ceres-solver configuration. =============================================================== Detected Ceres version: 1.13.0 from E:/openmvg/openMVG/src/third_party/ceres-solver/include/ceres/version.h Eigen 3.4.0 found (include: E:/openmvg/openMVG/src/third_party/eigen) -- Found Eigen version 3.4.0: E:/openmvg/openMVG/src/third_party/eigen =============================================================== Enabling the use of Eigen as a sparse linear algebra library for solving the nonlinear least squares problems. Enabling this option results in an LGPL licensed version of Ceres Solver as the Simplicial Cholesky factorization in Eigen is licensed under the LGPL. =============================================================== Performing Test CMAKE_HAVE_LIBC_PTHREAD Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed Looking for pthread_create in pthreads Looking for pthread_create in pthreads - not found Looking for pthread_create in pthread Looking for pthread_create in pthread - not found Found Threads: TRUE -- Did not find LAPACK library, disabling LAPACK support. -- Did not find BLAS library, disabling LAPACK support. -- Building without SuiteSparse. -- Building without CXSPARSE. -- Google Flags disabled; no tests or tools will be built! -- Compiling minimal glog substitute into Ceres. -- Using minimal glog substitute (include): internal/ceres/miniglog -- Building with OpenMP. Performing Test COMPILER_HAS_CXX11_FLAG Performing Test COMPILER_HAS_CXX11_FLAG - Success Looking for C++ include unordered_map Looking for C++ include unordered_map - found Performing Test HAVE_UNORDERED_MAP_IN_STD_NAMESPACE Performing Test HAVE_UNORDERED_MAP_IN_STD_NAMESPACE - Success -- Found unordered_map/set in std namespace. Looking for C++ include memory Looking for C++ include memory - found Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE - Success -- Found shared_ptr in std namespace using <memory> header. -- Building Ceres as a static library. Performing Test HAVE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS Performing Test HAVE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS - Success Creating configured Ceres config.h output directory: D:/Openmvg/third_party/ceres-solver/config/ceres/internal Enabling CERES_USE_EIGEN_SPARSE in Ceres config.h Enabling CERES_NO_LAPACK in Ceres config.h Enabling CERES_NO_SUITESPARSE in Ceres config.h Enabling CERES_NO_CXSPARSE in Ceres config.h Enabling CERES_USE_OPENMP in Ceres config.h Enabling CERES_STD_UNORDERED_MAP in Ceres config.h Enabling CERES_MSVC_USE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS in Ceres config.h -- Do not build any example. =============================================================== Ceres-solver configuration end. =============================================================== Configured Eigen 3.4.0 ** Found Qt5, GUI modules will be build Found Sphinx: F:/Anaconda3/Scripts/sphinx-build.exe Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) Doxygen need to be installed to generate the doxygen documentation ** OpenMVG version: 2.1.0 ** Build Shared libs: OFF ** Build OpenMVG tests: OFF ** Build OpenMVG softwares: ON ** Build OpenMVG GUI softwares: ON ** Build OpenMVG documentation: ON ** Build OpenMVG samples applications: ON ** Build OpenMVG openGL examples: OFF ** Use Rerun logging: ON ** Enable code coverage generation: OFF ** Enable OpenMP parallelization: ON ** Build OpenCV+OpenMVG samples programs: OFF ** Use OpenCV SIFT features: OFF ** Use LiGT for global translation estimation: ON CEREAL: (internal) EIGEN: 3.4.0 (internal) CERES: 1.13.0 (internal) LIBTIFF: 4.5.1 (external) LIBPNG: (internal) LIBJPEG (internal) CLP: 1.16.10 (internal) COINUTILS: 2.10.13 (internal) OSI: (internal) LEMON: 1.3 (internal) Configuring done (47.4s)
最新发布
09-12
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值