转载请注明出处: http://blog.csdn.net/guoyjoe/article/details/47171673
-------碰到各种报错,一步步排错!
##########################
一、报错1##########################
root@guoy-infer:/uubee/PrePay_AndroidClientDemo# infer -- ./gradlew build Traceback (most recent call last): File "/root/infer-0.1.1/infer/bin/infer", line 141, in <module> main() File "/root/infer-0.1.1/infer/bin/infer", line 118, in main capture_exitcode = imported_module.gen_instance(args, cmd).capture() File "/root/infer-0.1.1/infer/bin/.. b/capture/gradle.py", line 41, in capture cmds = self.get_inferJ_commands(util.get_build_output(self.build_cmd)) File "/root/infer-0.1.1/infer/bin/.. b/capture/util.py", line 24, in get_build_output proc = subprocess.Popen(build_cmd, stdout=subprocess.PIPE) File "/usr b/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/usr b/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
##############################
二、报错2
##############################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 09:52:16.759 [ERROR] [org.gradle.BuildExceptionReporter] 09:52:16.775 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 09:52:16.777 [ERROR] [org.gradle.BuildExceptionReporter] 09:52:16.778 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 09:52:16.781 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring project ‘:app‘. 09:52:16.783 [ERROR] [org.gradle.BuildExceptionReporter] > The SDK directory ‘/uubee/PrepayDemo/D:\Android\sdk‘ does not exist. 09:52:16.789 [ERROR] [org.gradle.BuildExceptionReporter] 09:52:16.794 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 09:52:16.795 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
#########################
三、报错3
#########################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 10:44:36.995 [ERROR] [org.gradle.BuildExceptionReporter] 10:44:37.006 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 10:44:37.015 [ERROR] [org.gradle.BuildExceptionReporter] 10:44:37.022 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 10:44:37.023 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring project ‘:app‘. 10:44:37.025 [ERROR] [org.gradle.BuildExceptionReporter] > failed to find target android-22 : /uubee/android-sdk-linux 10:44:37.034 [ERROR] [org.gradle.BuildExceptionReporter] 10:44:37.041 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 10:44:37.043 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
######################
四、报错4
######################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 11:28:21.050 [ERROR] [org.gradle.BuildExceptionReporter] 11:28:21.057 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 11:28:21.065 [ERROR] [org.gradle.BuildExceptionReporter] 11:28:21.066 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 11:28:21.070 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring project ‘:app‘. 11:28:21.077 [ERROR] [org.gradle.BuildExceptionReporter] > failed to find Build Tools revision 22.0.1 11:28:21.082 [ERROR] [org.gradle.BuildExceptionReporter] 11:28:21.084 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 11:28:21.089 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
######################################
五、报错5
######################################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 11:56:22.658 [ERROR] [org.gradle.BuildExceptionReporter] 11:56:22.666 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 11:56:22.672 [ERROR] [org.gradle.BuildExceptionReporter] 11:56:22.675 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 11:56:22.679 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring project ‘:app‘. 11:56:22.683 [ERROR] [org.gradle.BuildExceptionReporter] > A problem occurred configuring project ‘:prepay‘. 11:56:22.689 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve all dependencies for configuration ‘:prepay:_debugCompile‘. 11:56:22.700 [ERROR] [org.gradle.BuildExceptionReporter] > Could not find com.android.support:appcompat-v7:22.2.0. 11:56:22.702 [ERROR] [org.gradle.BuildExceptionReporter] Searched in the following locations: 11:56:22.704 [ERROR] [org.gradle.BuildExceptionReporter] https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.pom 11:56:22.706 [ERROR] [org.gradle.BuildExceptionReporter] https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.jar 11:56:22.711 [ERROR] [org.gradle.BuildExceptionReporter] Required by: 11:56:22.714 [ERROR] [org.gradle.BuildExceptionReporter] PrepayDemo:prepay:unspecified 11:56:22.715 [ERROR] [org.gradle.BuildExceptionReporter] 11:56:22.719 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 11:56:22.721 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
#########################################
六、报错6
#########################################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 13:53:50.873 [ERROR] [org.gradle.BuildExceptionReporter] 13:53:50.888 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 13:53:50.894 [ERROR] [org.gradle.BuildExceptionReporter] 13:53:50.898 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 13:53:50.902 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:prepay:processReleaseResources‘. 13:53:50.904 [ERROR] [org.gradle.BuildExceptionReporter] > A problem occurred starting process ‘command ‘/uubee/android-sdk-linuxild-tools/22.0.1/aapt‘‘ 13:53:50.914 [ERROR] [org.gradle.BuildExceptionReporter] 13:53:50.916 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 13:53:50.922 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
#######################################
七、报错7
#######################################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 14:39:11.171 [ERROR] [org.gradle.api.Project] /uubee/android-sdk-linux/build-tools/22.0.1/aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory 14:39:11.221 [ERROR] [org.gradle.BuildExceptionReporter] 14:39:11.232 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 14:39:11.239 [ERROR] [org.gradle.BuildExceptionReporter] 14:39:11.242 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 14:39:11.251 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:prepay:processReleaseResources‘. 14:39:11.259 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/uubee/android-sdk-linux/build-tools/22.0.1/aapt‘‘ finished with non-zero exit value 127 14:39:11.263 [ERROR] [org.gradle.BuildExceptionReporter] 14:39:11.265 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 14:39:11.275 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
######################
八、报错8
######################
root@guoy-infer:/uubee/PrepayDemo# infer -- ./gradlew build 14:43:42.651 [ERROR] [system.err] /uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/net/PrePayClient.java:18: error: class PrepayClient is public, should be declared in a file named PrepayClient.java 14:43:42.664 [ERROR] [system.err] public enum PrepayClient { 14:43:42.674 [ERROR] [system.err] ^ 14:43:46.012 [ERROR] [system.err] Note: Some input files use or override a deprecated API. 14:43:46.025 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details. 14:43:46.031 [ERROR] [system.err] Note: /uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/CashSelectActivity.java uses unchecked or unsafe operations. 14:43:46.037 [ERROR] [system.err] Note: Recompile with -Xlint:unchecked for details. 14:43:46.046 [ERROR] [system.err] 1 error 14:43:46.088 [ERROR] [org.gradle.BuildExceptionReporter] 14:43:46.091 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 14:43:46.102 [ERROR] [org.gradle.BuildExceptionReporter] 14:43:46.108 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 14:43:46.111 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:prepay:compileReleaseJava‘. 14:43:46.118 [ERROR] [org.gradle.BuildExceptionReporter] > Compilation failed; see the compiler error output for details. 14:43:46.127 [ERROR] [org.gradle.BuildExceptionReporter] 14:43:46.130 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 14:43:46.146 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. [ERROR] Javac compilation error with: [‘javac‘, ‘-g‘, ‘-d‘, ‘/uubee/PrepayDemo/prepay/build/intermediates/classes/release‘, ‘-g‘, ‘-encoding‘, ‘UTF-8‘, ‘-bootclasspath‘, ‘/uubee/android-sdk-linux/platforms/android-22/android.jar‘, ‘-classpath‘, ‘/uubee/PrepayDemo/prepay/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars/libs/internal_impl-22.2.0.jar:/uubee/android-sdk-linux/extras/android/m2repository/com/android/support/support-annotations/22.2.0/support-annotations-22.2.0.jar:/root/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.3.1/ecb6e1f8e4b0e84c4b886c2f14a1500caf309757/gson-2.3.1.jar:/root/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar:/uubee/PrepayDemo/prepay/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars/classes.jar:/uubee/PrepayDemo/prepay/libs/fraudmetrix-2.0.0.9e3b3.jar:/uubee/PrepayDemo/prepay/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars/classes.jar‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/api/PrepayAgent.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/api/OnResultListener.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/dialog/InfoConfirmDialog.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/QueryInfo.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/BaseOrder.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/MsgVerifyOrder.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/ActiveOrder.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/BaseInfo.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/QueryOrder.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/PayInfo.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/ApplyInfo.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/BillQueryInfo.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/PayOrder.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/InitResponse.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/PayResult.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/model/CashGift.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/security/SDKEncrypt.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/security/SDKDecrypt.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/security/BaseCipher.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/view/CircleButton.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/view/ProgressWebView.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/view/TextWatcherAdapter.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/Constants.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/MD5.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/SignUtils.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/PhoneInfo.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/DebugLog.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/Base64.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/Utils.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/util/Rsa.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/net/PrePayClient.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/net/PrepayRequest.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/net/BaseResponse.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/net/BaseRequest.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/core/PrePayImpl.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/core/PrepayApi.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/FirstPayActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/BaseActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/CashSelectActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/PayResultActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/PersonalInfoSupplyActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/HelpActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/FastPayActivity.java‘, ‘/uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/BasePayActivity.java‘, ‘/uubee/PrepayDemo/prepay/build/generated/source/r/release/com/uubee/prepay/R.java‘, ‘/uubee/PrepayDemo/prepay/build/generated/source/buildConfig/release/com/uubee/prepay/BuildConfig.java‘] /uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/net/PrePayClient.java:18: error: class PrepayClient is public, should be declared in a file named PrepayClient.java public enum PrepayClient { ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /uubee/PrepayDemo/prepay/src/main/java/com/uubee/prepay/activity/CashSelectActivity.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
###################
九、完成
###################
root@guoy-infer:/uubee# infer -- ./gradlew build 15:20:15.395 [ERROR] [system.err] Note: Some input files use or override a deprecated API. 15:20:15.407 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details. 15:20:15.417 [ERROR] [system.err] Note: /uubee/prepay/src/main/java/com/uubee/prepay/activity/CashSelectActivity.java uses unchecked or unsafe operations. 15:20:15.419 [ERROR] [system.err] Note: Recompile with -Xlint:unchecked for details. 15:20:29.947 [ERROR] [system.err] Note: /uubee/app/src/main/java/com/uubee/prepay/demo/SignUtils.java uses or overrides a deprecated API. 15:20:29.957 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details. 15:21:42.238 [ERROR] [system.err] Note: /uubee/app/src/main/java/com/uubee/prepay/demo/SignUtils.java uses or overrides a deprecated API. 15:21:42.239 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details. 15:22:07.026 [ERROR] [org.gradle.BuildExceptionReporter] 15:22:07.033 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 15:22:07.039 [ERROR] [org.gradle.BuildExceptionReporter] 15:22:07.041 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 15:22:07.043 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:app:lint‘. 15:22:07.046 [ERROR] [org.gradle.BuildExceptionReporter] > Lint found errors in the project; aborting build. 15:22:07.054 [ERROR] [org.gradle.BuildExceptionReporter] 15:22:07.056 [ERROR] [org.gradle.BuildExceptionReporter] Fix the issues identified by lint, or add the following to your build script to proceed with errors: 15:22:07.060 [ERROR] [org.gradle.BuildExceptionReporter] ... 15:22:07.062 [ERROR] [org.gradle.BuildExceptionReporter] android { 15:22:07.064 [ERROR] [org.gradle.BuildExceptionReporter] lintOptions { 15:22:07.066 [ERROR] [org.gradle.BuildExceptionReporter] abortOnError false 15:22:07.068 [ERROR] [org.gradle.BuildExceptionReporter] } 15:22:07.069 [ERROR] [org.gradle.BuildExceptionReporter] } 15:22:07.074 [ERROR] [org.gradle.BuildExceptionReporter] ... 15:22:07.077 [ERROR] [org.gradle.BuildExceptionReporter] 15:22:07.081 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 15:22:07.082 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Starting analysis (Infer version git-) Analysis finished in 64.300950s 61 files analyzed /uubee/prepay/src/main/java/com/uubee/prepay/core/PrePayImpl.java:184: error: NULL_DEREFERENCE object cursor last assigned on line 182 could be null and is dereferenced at line 184 /uubee/prepay/src/main/java/com/uubee/prepay/core/PrePayImpl.java:221: error: NULL_DEREFERENCE object cursor last assigned on line 216 could be null and is dereferenced at line 221 /uubee/prepay/src/main/java/com/uubee/prepay/core/PrePayImpl.java:230: error: NULL_DEREFERENCE object phoneCursor last assigned on line 228 could be null and is dereferenced at line 230 /uubee/prepay/src/main/java/com/uubee/prepay/net/PrepayRequest.java:25: error: NULL_DEREFERENCE object json last assigned on line 24 could be null and is dereferenced at line 25
root@guoy-infer:/uubee/infer-out# pwd /uubee/infer-out root@guoy-infer:/uubee/infer-out# ll total 384 drwxr-xr-x 7 root root 4096 7? 31 15:23 ./ drwxr-xr-x 11 root root 4096 7? 31 15:36 ../ -rw-r--r-- 1 root root 742 7? 31 15:23 bugs.txt drwx------ 63 root root 4096 7? 31 15:22 captured/ drwxr-xr-x 4 root root 4096 7? 31 15:22 classnames/ drwx------ 2 root root 4096 7? 31 15:22 log/ -rw-r--r-- 1 root root 242837 7? 31 15:23 procs.csv -rw-r--r-- 1 root root 11499 7? 31 15:23 report.csv -rw-r--r-- 1 root root 12252 7? 31 15:23 report.json drwx------ 2 root root 4096 7? 31 15:22 sources/ drwx------ 2 root root 90112 7? 31 15:23 specs/ -rw-r--r-- 1 root root 215 7? 31 15:23 stats.json
############################
总结
############################
下载 andior SDK:
https://developer.android.com/sdk/index.html#Other
andior SDK组件安装
http://mirrors.neusoft.edu.cn/ #镜像(mirrors.neusoft.edu.cn)
步骤:
1、安装infer
2、安装gradle
3、安装andior SDK(Android5.1.1 API22-->SDK platform)
#####JAVA
https://github.com/facebook/infer/issues/21
https://github.com/facebook/infer/issues/38
java 项目可以试试 infer —ant 或者infer —mvn
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/guoyjoe/article/details/47171673