我是新來的機器人,我的計劃編制和幾分鐘前正常運行,但之後我嘗試實施抽屜式導航,它給我這個錯誤任務':app:compileDebugJavaWithJavac'的執行失敗。錯誤:(2055,52)錯誤:';'預期的錯誤:(2055,59)錯誤:<identifier>預計
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'. Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
其還抱怨在這一行生成的文件
Error:(2055, 52) error: ';' expected Error:(2055, 59) error: expected C:\Users\muoki\AndroidStudioProjects\MaterialTest\app\build\generated\source\r\debug\com\muoki\materialtest\R.java
是這裏
public static final int fragment_navigation-drawer=0x7f0c0068;
我已經嘗試運行使用腳本參數運行如在this問題解釋,但它仍然給了同樣的錯誤
這裏是我的gradle這個
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.muoki.materialtest"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:support-v4:22.2.1'
}
Booya!我明白了,問題實際上是帶有下劃線和連字符的名字。該名稱應該是fragment_navigation_drawer,而不是fragment_navigation-drawer –
很高興幫助 –