Büşra Afşar
Büşra Afşar

Reputation: 55

Android Studio, Xml autocomplete not working

I manually modified on build.gradle file. I made minSdkVersion from 21 to 14. Then I made 21 again by manually because of errors I received. After this process, autocomplete does not work in xml editor. I tried invalid caches and restart and delete .idea folder . But it doesn't work.

Upvotes: 0

Views: 2400

Answers (4)

devMohaned
devMohaned

Reputation: 145

Compile/Target SDK 33 (2022)

If you're facing this problem with SDK 33, lower your sdk to 32, That fixed my problem

  1. Go to your build.gradle file (Module)
  2. Change your compileSdk to 32
  3. Change your targetSdk to 32
  4. Sync & Rebuild

Your gradle file should look like this

android {
compileSdk 32

defaultConfig {
    applicationId "com.package.name"
    minSdk 21
    targetSdk 32
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}
}

That should fix your issue

Upvotes: 1

Zeinab Rahnamaee
Zeinab Rahnamaee

Reputation: 53

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

build-cache to build-cache_old Go to C:\Users\UserName.AndroidStudio3.2\system and rename these folders:

caches to caches_old

compiler to compiler_old

compile-server to compile-server_old

conversion to conversion_old

external_build_system to external_build_system_old

frameworks to frameworks_old

gradle to gradle_old

resource_folder_cache to resource_folder_cache_old

Open the Android Studio and open your project again.

Upvotes: 1

mili2501
mili2501

Reputation: 452

These following steps are working for me:

  1. Close android studio
  2. Go to path/.AndroidStudio3.5/system/ delete caches folder
  3. Start android studio

Upvotes: 0

Freedom Chuks
Freedom Chuks

Reputation: 750

Simply in your project

  • Delete your .idea folder.

  • Delete all .iml files.

  • Then invalidate caches and restart..To do that:

  • Go to File -> Invalidate Caches/Restart -> Invalidate

  • Then finally Rebuild project....

Hope this helps you

Upvotes: 0

Related Questions