Failure [INSTALL_FAILED_OLDER_SDK] Android-L, Android Studio.

装了个Android Studio,编译的时候,提示

Failure [INSTALL_FAILED_OLDER_SDK],不管怎么换编译版本都不行。

最终在StackOverflow上找到答案了,app/build.gradle 中的这两行问题
compileSdkVersion 'android-L'
    buildToolsVersion '20.0.0'
换成你电脑中下载的其它版本的SDK和buildTools版本就可以了。
原因是:这android-L于其之前的版本不兼容,甚至是21也不兼容。
If you compile against a preview SDK (android-L), the build tools will lock minSdkVersion and targetSdkVersion to that same API level. 
。如果使用android-L编译,那么编译工具就会将minSdkVersion 和 targetSdkVersion 锁定到android-L。
所以换一下就会好了。

stackoverflow 帖子在这: 点击这里
PS C:\Users\shang\AppData\Local\Temp\unified_server(2).py1787532444930598> pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting opencv-python Using cached https://pypi.tuna.tsinghua.edu.cn/packages/17/06/68c27a523103dad5837dc5b87e71285280c4f098c60e4fe8a8db6486ab09/opencv-python-4.11.0.86.tar.gz (95.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy>=1.13.3 in d:\programdata\anaconda3\lib\site-packages (from opencv-python) (1.19.4) Building wheels for collected packages: opencv-python Building wheel for opencv-python (pyproject.toml) ... error ERROR: Command errored out with exit status 1: command: 'D:\ProgramData\Anaconda3\python.exe' 'D:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\shang\AppData\Local\Temp\tmpt37wunkv' cwd: C:\Users\shang\AppData\Local\Temp\pip-install-_e4wuhw5\opencv-python_1977012de0b84efa86f25c93f367b4ae Complete output (395 lines): -------------------------------------------------------------------------------- -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator Ninja does not support platform specification, but platform x64 was specified. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'Visual Studio 17 2022 x64 v143' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator Visual Studio 17 2022 could not find any instance of Visual Studio. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Visual Studio 17 2022 x64 v143' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator Ninja does not support platform specification, but platform x64 was specified. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'Visual Studio 16 2019 x64 v142' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator Visual Studio 16 2019 could not find any instance of Visual Studio. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Visual Studio 16 2019 x64 v142' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator Ninja does not support platform specification, but platform x64 was specified. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'Visual Studio 15 2017 x64 v141' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator Visual Studio 15 2017 could not find any instance of Visual Studio. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Visual Studio 15 2017 x64 v141' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator NMake Makefiles does not support platform specification, but platform x64 was specified. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator NMake Makefiles does not support platform specification, but platform x64 was specified. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. CMake Deprecation Warning at 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 Error at CMakeLists.txt:2 (PROJECT): Generator NMake Makefiles does not support platform specification, but platform x64 was specified. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator - failure -------------------------------------------------------------------------------- ******************************************************************************** scikit-build could not get a working generator for your system. Aborting build. Building windows wheels for Python 3.6 requires Microsoft Visual Studio 2022. Get it with "Visual Studio 2017": https://visualstudio.microsoft.com/vs/ Or with "Visual Studio 2019": https://visualstudio.microsoft.com/vs/ Or with "Visual Studio 2022": https://visualstudio.microsoft.com/vs/ ******************************************************************************** ---------------------------------------- ERROR: Failed building wheel for opencv-python Failed to build opencv-python ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
最新发布
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值