API离线文档不适用于android

API离线文档不适用于android

本文介绍了Android SDK API离线文档不适用于android studio,所有软件包均不可下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了android studio并安装了它,并下载了API 30.0.1

Hi,I downloaded android studio and installed it downloaded API 30.0.1

但是当我按Ctrl + Q显示内联文档时,android studio会尝试从网络 online

but when I press Ctrl+Q to show inline docs, android studio try to fetch it from the network online

我需要它离线工作,我无法在SDK管理器中找到旧选项

I need it to work offline, I can not find the old option in the SDK manager

Android SDK文档

当我尝试导航至android API中的任何类或方法时,导航至源Ctrl + L-鼠标按钮

And when I try to navigate to any class or method in android API navigate to source Ctrl + L-mouse-button

android studio给我看

android studio show me

当我按下右上角的下载选项

and when I press on download option in the top right corner

它告诉我

这是我的SDK管理器

项目

然后build.gradle Module

And build.gradle Module


apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.1"

    defaultConfig {
        applicationId "com.albanna.databaseworks"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

}

build.gradle Project

build.gradle Project


// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我的SDK文件夹

Processor   Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz, 2592 Mhz, 6 Core(s), 12 Logical Processor(s)

BIOS Mode   UEFI

Installed Physical Memory (RAM) 16.0 GB, dual-channel 2666 MHz

SSD NVME M2 3200/2500 read/write MB/S


所以我需要它像IntelliJ IDE或Rider一样工作,当我在任何方法上按Ctrl + Q时,它都应该显示文档,并且我可以导航到源代码 Offline

推荐答案

我找到了解决方案

此问题是因为Google尚未提供API 30的源代码,所以我回到API 29,一切正常

I Found The Solution

This problem because Google does not provide the source code of API 30 yet, soI just go back to API 29, and everything work

来自文件项目结构模块

然后更改

  • 将SDK版本编译为 29
  • 构建工具版本 29.0.3
  • Compile Sdk Version to 29
  • Build Tools Version 29.0.3

另外请注意:您必须选择 Android 29的Source 或您拥有的任何版本在 SDK平台

Also notice: you must have Source For Android 29 or any version you have, selectedin SDK Platforms

我从读取此线程时发现了这个问题

这表示Google只会通过系统而非API来发布源代码.

And this says that Google will only release the source with the system, not with the API.

所以我回到API 29

So I just go back to API 29

这篇关于Android SDK API离线文档不适用于android studio,所有软件包均不可下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 08:55