我已从某处复制此代码,以使用Splash屏幕创建Webview应用程序。但是,我在构建应用程序文件时不断收到此R.java错误:
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJavaWithJavac
/Users/Varun/AndroidStudioProjects/DiagnoseECG/app/build/generated/source/r/debug/package com/abcofecg/app/diagnoseecg/R.java:8: error: <identifier> expected
package package com.abcofecg.app.diagnoseecg;
^
/Users/Varun/AndroidStudioProjects/DiagnoseECG/app/build/generated/source/r/debug/package com/abcofecg/app/diagnoseecg/R.java:8: error: class, interface, or enum expected
package package com.abcofecg.app.diagnoseecg;
^
/Users/Varun/AndroidStudioProjects/DiagnoseECG/app/build/generated/source/buildConfig/debug/package com/abcofecg/app/diagnoseecg/BuildConfig.java:4: error: <identifier> expected
package package com.abcofecg.app.diagnoseecg;
^
/Users/Varun/AndroidStudioProjects/DiagnoseECG/app/build/generated/source/buildConfig/debug/package com/abcofecg/app/diagnoseecg/BuildConfig.java:4: error: class, interface, or enum expected
package package com.abcofecg.app.diagnoseecg;
^
4 errors
FAILED
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
Total time: 5.302 secs
请帮我解决此问题。
答案 0 :(得分:0)
这就是我这样做的事情。
(1)清理项目/构建 (2)重建项目 (3)同步Gradle (4)重启Android Studio
也许其中一个可以解决您的问题