股票计算;Android studio 软件报错

 期货技巧 配资网

Execution failed for task ':TestAndroid:compileDebug'.有各种各样原因股票计算,具体就请自己进cmd编译看什么地方32313133353236313431303231363533e59b9ee7ad9431333337613235出错进入项目的gradle文件所在目录打gradlew compileDebug --stacktrace来追踪就可以啦~昨天编译的时候出现了问题,具体问题具体解决!Gradle:FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':TestAndroid:compileDebug'.> 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.Could not execute build using Gradle installation 'C:\gradle-1.6'.首先进入命令行进入项目根目录(gradule文件所在目录)输入命令gradlew compileDebug --stacktrace查看错误位置:错误如下=================================================================C:\Users\Administrator\AndroidStudioProjects\TestAndroid\TestAndroid\src\main\java\com\example\testandroid\MainActivity.java:125: 警告:编码 GBK 的不可映射字符 //淇濆瓨褰揿墠璁$畻缁撴灉锛屼笅娆℃墦寮?仮澶? SharedPreferences settings = getSharedPreferences(PROFILE_NAME,Activity.MODE_PRIVATE); ^C:\Users\Administrator\AndroidStudioProjects\TestAndroid\TestAndroid\src\main\java\com\example\testandroid\MainActivity.java:125: 警告:编码 GBK 的不可映射字符 //淇濆瓨褰揿墠璁$畻缁撴灉锛屼笅娆℃墦寮?仮澶? SharedPreferences settings = getSharedPreferences(PROFILE_NAME,Activity.MODE_PRIVATE); ^C:\Users\Administrator\AndroidStudioProjects\TestAndroid\TestAndroid\src\main\java\com\example\testandroid\MainActivity.java:126: 找不到符号符号: 变量 settings SharedPreferences.Editor editor = settings.edit(); ^1 错误:TestAndroid:compileDebug FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':TestAndroid:compileDebug'.> Compilation failed; see the compiler error output for details.* Try:Run with --info or --debug option to get more log output.* Exception is:org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':TestAndroid:compileDebug'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter$1.run(CacheLockReleasingTaskExecuter.java:35) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)=======================================================因循错误应该是编码问题125行用了中文注释因为Gradle默认编译采用了GBK,但是java文件中的注释中文用UTF-8所以有问题设置Gradle的编译编码即可:具体方法打开项目结构structure打开gradle文件加入}