。下面是類...新的Android Studio項目無法解析符號「R」
package com.example.david.dynamicuifragments;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
我已經創建了多個項目,乾淨的構建,重建與gradle這個文件同步的項目。沒有任何修復是這樣的。請幫助
錯誤消息是: 錯誤:無法緊縮文件C:\用戶\大衛\ OneDrive \開發\ MyAndroidStudio \ AndroidDevelopersTraining \ DynamicUIFragments \程序\編譯\ \中間體爆炸-AAR \ com.android.support \程序兼容性-V7 \ 25.1.0 \水庫\繪製-xxhdpi-V4 \ abc_text_select_handle_middle_mtrl_light.png到C:\用戶\大衛\ OneDrive \開發\ MyAndroidStudio \ AndroidDevelopersTraining \ DynamicUIFragments \程序\編譯\中間體\水庫\合併\調試\ drawable-xxhdpi-v4 \ abc_text_select_handle_middle_mtrl_light.png
錯誤:執行任務':app:mergeDebugResources'失敗。
Error: Failed to crunch file C:\Users\David\OneDrive\Development\MyAndroidStudio\AndroidDevelopersTraining\DynamicUIFragments\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\res\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_light.png into C:\Users\David\OneDrive\Development\MyAndroidStudio\AndroidDevelopersTraining\DynamicUIFragments\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_light.png
由於@max建議乾淨和構建應該工作。如果不把你的光標附近'R.layout.activity_main'和打'ALT + ENTER'這將導入R類別您MainActivity – Shashanth
然後檢查你的SDK確保一切都更新 – max
檢查資源文件名,它應該被定義小寫 – NishchalAndroid