failed to find target android-7 Please install the missing platform

本文介绍了在使用Android Studio导入项目时遇到的“Failed to refresh Gradle project”错误及其解决方案。主要原因是缺少指定的Android平台版本,通过更新build.gradle文件中的API版本及安装缺失的平台来解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

用android-studio import 一个projects出现问题

Failed to refresh Gradle project 'demo'

Cause: failed to find target android-7

 Please install the missing platform from the Android SDK Manager.


解决:

(1)

  项目的build.gradle文件,把compileSdkVersion 、targetSdkVersion 都改成sdk Manager里installed的API版本

apply plugin: 'android'

android {
    compileSdkVersion 14
    buildToolsVersion "20.0.0"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 14
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':library')
    compile 'com.android.support:support-v4:20.0.0+'
}

http://www.th7.cn/Program/Android/201408/261686.shtml

(2)

Tools > Android > SDK Manager 把android 2.1(API7)勾选,installed

tao@thp:~/文档/PyTorch_Practice/lesson2/rmb_classification$ tensorboard --logdir=lesson5/runs 2025-03-25 19:57:40.459192: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2025-03-25 19:57:40.459794: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used. 2025-03-25 19:57:40.461640: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used. 2025-03-25 19:57:40.466451: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered WARNING: All log messages before absl::InitializeLog() is called are written to STDERR E0000 00:00:1742903860.474475 9404 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered E0000 00:00:1742903860.476797 9404 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered W0000 00:00:1742903860.483264 9404 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once. W0000 00:00:1742903860.483289 9404 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once. W0000 00:00:1742903860.483292 9404 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once. W0000 00:00:1742903860.483294 9404 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once. 2025-03-25 19:57:40.485439: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. E0000 00:00:1742903861.655321 9404 cuda_executor.cc:1228] INTERNAL: CUDA Runtime error: Failed call to cudaGetRuntimeVersion: Error loading CUDA libraries. GPU will not be used.: Error loading CUDA libraries. GPU will not be used. W0000 00:00:1742903861.664941 9404 gpu_device.cc:2341] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform. Skipping registering GPU devices... NOTE: Using experimental fast data loading logic. To disable, pass "--load_fast=false" and report issues on GitHub. More details: https://github.com/tensorflow/tensorboard/issues/4784 Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.19.0 at http://localhost:6006/ (Press CTRL+C to quit) 这里输入对应的网址打不开
03-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值