알 수없는 속성 android : layout_width, layout_height, id, gravity, layout_gravity, padding
모든 안드로이드 태그에서 알 수없는 속성 오류가 발생합니다.
레이아웃 XML에서 자동 제안은 모든 속성 (예 : layout_width, layout_height, orientation, orientation 및 기타 모든 Android 속성)을 표시하지 않습니다.
여기 스냅 샷이 있습니다
- 클린 빌드 및 재 구축
- .idea 파일 삭제
- 무효화 된 캐시 / 다시 시작 .. 옵션
- 절전 모드를 켭니다.
SDk가 최신 상태입니다.
앱 수준 Gridle에서
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.abhishek.ondemandservice"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
응용 프로그램 수준 Gride.
buildscript {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
mavenCentral()
}
}
Tools-> Android-> Sync Project with Gradle Files로 이동하십시오.
나를 위해 일한 유일한 것은 다음 폴더를 청소하는 것입니다.
c:\Users\<user>\.gradle\caches\
c:\Users\<user>\.AndroidStudio3.2\system\caches\
Android Studio는 라이브러리를 다시 다운로드하고 캐시하여 모든 것을 정상으로 되돌릴 수 있습니다.
출처 : https://stackoverflow.com/a/53053438/7515903
크레딧 : @alexuz
To fix, change something in your gradle file, then sync gradle again. This worked for me.
Credit: https://stackoverflow.com/a/47500156/5673746
I tried:
- Removing the build folders
- Cleaning the project
- Sync Project with Gradle Files
But nothing worked. Finally using File > Invalidate caches fixed the error.
I too encountered this..
Just delete the .idea folder that is in the project location
Build > Clean Project
Then change something in the app level gradle
Then android studio will ask you to sync the project. Go ahead and sync, the problem will be gone
Had the same issue, but after a reinstall of visual studio, so what helped for me on Android studio 3.2, was to go and upgrade the target version to 28 and compile version 28. Was at version 27 before.
I had to upgrade these packages as well
implementation "com.android.support:support-v4:28.0.0"
implementation 'com.android.support:support-core-ui:28.0.0'
After Gradle had synced then it worked for me.
if non of above answers dosn't work do these steps:
- first close android studio.
- than just go to windows>User or AppData>local> and delete androidstudio last version folder
- reopen androidstuduio and set default settings
Any of these ways will possibly fix your problem (unknown attribute android:layout-width)
- Sync project with Gradle file (File -> Sync project with Gradle files)
- Invalidate cache and restart (File -> Invalidate cache and restart -> Invalidate and restart)
- Delete .gradle and .idea file from the project folder and rebuild the project.
- Delete caches folder from Android studio (.AndroidStudio3.2 -> system -> caches)
In my case none of the above solutions worked for me, but changing the minSdkVersion
to a higher version and doing a gradle sync after that did the trick, maybe this would be useful to somebody.
None of the existing suggestion works for me. I solved this issue by reinstalling Android Studio. Really weird.
I had to
- Delete Android SDK from AppData\Local\Android\Sdk
- Reinstall Android Studio
I just changed my android SDK path and restart android studio->set new SDK path it working
Just update your android studio: Help -> Check for Updates..
'IT Share you' 카테고리의 다른 글
Jade의 줄 바꿈은 어떻습니까? (0) | 2020.11.17 |
---|---|
Mac 터미널에서 C ++ 11 지원으로 C ++를 컴파일하는 방법 (0) | 2020.11.17 |
Java 상수 풀의 목적은 무엇입니까? (0) | 2020.11.16 |
파이썬에서 확장자가없는 파일 유형을 확인하는 방법은 무엇입니까? (0) | 2020.11.16 |
GridView를 ScrollView에 넣는 방법 (0) | 2020.11.16 |