Program Tip

Android Studio-XML 편집기 자동 완성이 지원 라이브러리에서 작동하지 않음

programtip 2020. 11. 22. 20:25
반응형

Android Studio-XML 편집기 자동 완성이 지원 라이브러리에서 작동하지 않음


방금 새로운 android.support.design 라이브러리를 사용하기 시작했습니다. XML 편집기 내에서 위젯을 사용할 때 XML 자동 완성 제안이 더 이상 표시되지 않습니다!

예를 들면

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/header_root"
    android:layout_width="match_parent"
    android:layout_height="200dp">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/primary_dark" />

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:src="@drawable/ic_action_add"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="56dp"
        app:fabSize="normal"
        app:layout_anchor="@id/header_root"
        app:layout_anchorGravity="bottom|right|end" />

</android.support.design.widget.CoordinatorLayout>

어떤 태그도 자동 완성 팝업을 표시하지 않습니다. "android : i"를 입력하기 시작하면 팝업이 나타나지 않고, 내가 얻는 유일한 제안은 다음 그림에 표시됩니다.

여기에 이미지 설명 입력

내 프로젝트를 정리하고, PC를 다시 시작하고, Android Studio를 다시 시작하려고했습니다. 아무것도 작동하지 않습니다!


나는 많은 것을 시도했습니다 (Android Studio, PC 다시 시작, 캐시 무효화, 절전 모드 등).

마지막으로 프로젝트에서 .idea 폴더와 모든 .iml 파일을 삭제 하고 Android Studio를 다시 시작하고 gradle을 다시 빌드했습니다. XML 지원 라이브러리의 자동 완성이 다시 작동합니다.

Version Control에서 파일을 체크 아웃하거나 새 프로젝트의 모든 소스 파일을 복사하는 것도 트릭입니다.


NONE위의 답변 중 효과가 있다면 ...

Android 스튜디오 설치 디렉토리로 이동하세요.

yourDrive:/.AndroidStudio3.3/system

캐시 폴더 삭제 (그 실행하면 먼저 가까운 안드로이드 스튜디오).

그런 다음 Android Studio를 다시 시작하십시오. 끝난.

추신 나는 android studio 3.3을 사용하고 있습니다.


캐시를 무효화하고 다시 시작하여 자동 완성 제안을 다시 받았습니다.

파일-> 캐시 무효화 / 다시 시작 ...-> 무효화 및 다시 시작 선택


This same problem appeared in version 3.2. . The solution for that is

Close Android Studio
Go to C:\Users\UserName\.android and rename the build-cache folder to build-cache.bak

Go to C:\Users\UserName\.AndroidStudio3.2\system and rename these folders

caches to caches.bak

compiler to compiler.bak

compile-server to compile-server.bak

conversion to conversion.bak

external_build_system to external_build_system.bak

frameworks to frameworks.bak

gradle to gradle.bak

resource_folder_cache to resource_folder_cache.bak

Open the Android Studio and open your project again.

If NONE of the above worked ...

Just navigate to your android studio installation directory, i.e,

yourDrive:/.AndroidStudio3.4/system

first close android studio, if its running.

then delete the cache folder in system

Then start Android Studio again. Done.

i am using android studio 3.4


I got in a situation where only the EditText tag was broken. I've deleted the .idea folder and all .iml, invalidated the cache and restarted... What actually worked was to erase the tag and type it again. Really Odd.


Deleting Library/Application Support/AndroidStudio* folder and Invalidate Cache after that helped me. All other options didn't work.


A few years too late, but I wanted to submit an answer to this that I figured out and worked for me. It was very quick and didnt require a lot of reconfiguration as some of other answers on here had, so I thought I'd add it.

Solution

Comment the gradle dependencies for xml attributes, sync the project, and then un-comment them and sync it again. For me, resyncing these three with and then without the comments was enough to get them to start coming up again.

//implementation 'com.android.support:appcompat-v7:27.1.1'
//implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//implementation 'com.android.support:design:27.1.1'

And don't worry if your build fails after the first step, it should if you already have any of those attributes in your project. Another note, the attributes that I had previously put in (without the autocomplete before the resync) needed to be re-inputted for some reason.


The Santanu Sur answer works for me! But in Windows I found these folders in %USERNAME%/.AndroidStudio3.4 or %USERNAME%/.AndroidStudio3.3

I deleted these two folders and it worked well finally.


In my case Code Completion suggestions were not appearing because Gradle dependency was missing in my application's module.

I was using android.support.design.widget.TabLayout in my XML layout, but I have not added Design Support Library compile 'com.android.support:design:25.3.1' Gradle dependency in my application module.


If you're having this problem in November 2018 with Android Studio 3.2.1, you should try downgrading it to 3.1.4.

With 3.2.1 i tried every of this answers and didn't work, but after i downgraded to 3.1.4 and did the Invalidate Caches / Restart it worked fine.


I tried with Invalid caches/restart option but it didn't work for me. For Android Studio 3> versions check following first:

compileSdkVersion
targetSdkVersion
buildToolsVersion

Set these 3 to the latest version and then try to sync the project and clean, ReBuild once. It will work and show the XML editor autocomplete options.


Solved by deleting '.androidStudioPreview1.X' in my home folder.


I too got in a situation where only the EditText tag was broken. The solution was found in Setting > Editor >General > Auto Import where Edit Text was listed as excluded from auto completion. Remove that by select and click Minus sign.


파일-> 캐시 무효화 / 다시 시작 ...-> 무효화 및 다시 시작 선택

절전 모드가 작동하지 않습니다.


안드로이드 스튜디오의 전체 폴더`를 삭제하고 다시 시작하세요. 문제를 풀다

driveLocation : /. AndroidStudio3.3

.AndroidStudio3.3 귀하의 경우에는 다를 수 있습니다


가장 좋은 방법은 프로젝트의 zip 폴더를 만들고 경로를 변경하는 것입니다 (이 프로젝트를 여는 것보다 재배치). 이것은 필요한 일을 할 것입니다.


나를 위해 일한 것은 $ USERDIR / .AndroidStudio3.3 / system 폴더의 이름을 바꾸고 AS를 다시 시작하는 것입니다.

참고 URL : https://stackoverflow.com/questions/30684613/android-studio-xml-editor-autocomplete-not-working-with-support-libraries

반응형