本文介绍了离线运行检查(来自Jenkins)Android Studio 1.1 vs 1.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到Android Studio 1.5后 - inspections.sh停止运行并显示以下消息。

After upgrading to Android Studio 1.5 - inspections.sh stopped running with the following message.

/Applications/Android\ Studio.app/Contents/bin/inspect.sh /Users/cosminstirbu/MyApp  /Users/cosminstirbu/MyApp/inspections_profile.xml /Users/cosminstirbu/MyApp/inspectionsresults -v2 -d /Users/cosminstirbu/MyApp/app
2016-01-06 14:46:20.696 studio[6443:163537] Value of STUDIO_JDK: (null)
2016-01-06 14:46:20.706 studio[6443:163547] fullFileName is: /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2016-01-06 14:46:20.706 studio[6443:163547] fullFileName exists: /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2016-01-06 14:46:20.707 studio[6443:163547] Value of STUDIO_VM_OPTIONS is (null)
2016-01-06 14:46:20.707 studio[6443:163547] Processing VMOptions file at /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2016-01-06 14:46:20.707 studio[6443:163547] Done
2016-01-06 14:46:20.707 studio[6443:163547] Processing VMOptions file at /Users/cosminstirbu/Library/Preferences/AndroidStudio1.5/studio.vmoptions
2016-01-06 14:46:20.707 studio[6443:163547] No content found
2016-01-06 14:46:20.708 studio[6443:163547] Processing VMOptions file at 
2016-01-06 14:46:20.708 studio[6443:163547] No content found
/Applications/Android Studio.app/Contents/bin/idea.properties: 'java.endorsed.dirs' already defined
Jan  6 14:46:26 users-MacBook-Pro.local studio[6443] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan  6 14:46:26 users-MacBook-Pro.local studio[6443] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan  6 14:46:26 users-MacBook-Pro.local studio[6443] <Warning>: CGSConnectionByID: 0 is not a valid connection ID.
Jan  6 14:46:26 users-MacBook-Pro.local studio[6443] <Warning>: Invalid Connection ID 0
Starting up Android Studio 1.5.1 ...done.
Opening project...done.
Initializing project...Loaded profile 'MyApp' from file '/Users/cosminstirbu/MyApp/inspections_profile.xml'
done.
Inspecting with profile 'MyApp'
This project contains no modules. Inspection cannot proceed.

下面你可以找到.gitignore文件

Below you can find the .gitignore file

# Built application files
build

# Crashlytics configuations
com_crashlytics_export_strings.xml

# Local configuration file (sdk path, etc)
local.properties

# Gradle generated files
.gradle/

# Signing files
.signing/

# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

所以它说该项目不包含任何模块。

So it says that the project does not contain any modules.

我的猜测是因为忽略了一些文件,因为在我用Android Studio打开项目然后运行检查后,它就可以工作。

My guess is it happens because of some ignored files, because after I open the project with Android Studio and then run inspections, it works.

在它没有说什么应该提交或不提交哪些文件。我绝对不想提交workspace.xml和.iml文件。

In https://www.jetbrains.com/ruby/help/running-inspections-offline.html it doesn't say anything about which files should be committed or not. And I definitely don't want to commit the workspace.xml and the .iml files.

推荐答案

检查需要IntelliJ IDEA项目工作。至少,您需要.iml文件,.idea / modules.xml以及.idea / libraries下的所有内容。与.gitignore文件中的注释相反,这些文件都不包含特定于用户的配置,所有这些文件都设计为签入VCS并与其他用户共享。

The inspections require an IntelliJ IDEA project to work. At a minimum, you need the .iml files, .idea/modules.xml and everything under .idea/libraries. Contrary to what the comment in your .gitignore file says, none of these files contains user-specific configurations, and all of those files are designed to be checked in to the VCS and shared with other users.

(如果您正在使用Gradle,则无需签入* .iml和其他文件,因为在IDE中打开build.gradle时可以生成它们,但离线检查会执行不支持build.gradle导入,并且需要存在实际的项目和模块文件。)

(You don't need to check in *.iml and the other files if you're using Gradle, because they can be generated when you open build.gradle in the IDE, but the offline inspections do not support build.gradle import, and require the actual project and module files to be present.)

您不需要workspace.xml文件,事实上它确实存在包含您的用户特定配置。

You don't need the workspace.xml file, which does in fact contain your user-specific configuration.

这篇关于离线运行检查(来自Jenkins)Android Studio 1.1 vs 1.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 19:18