I am using AndroidStudio to build NDK based applications with C and C++ code.
The IDE goes overboard with warnings, like the one below:
How can I disable this and other gratuitous warnings from the IDE?
Is this done on a per-project base, or an IDE setting?
In any case, the deluge of warnings are not helping.
Ubuntu LTS
Android Studio 3.5
Native code built via gradle/cmake.
Release notes of Android Studio state:
Android Studio now includes support for static code analysis using
Clang-Tidy for projects that include native code. To enable support
for Clang-Tidy, update your NDK to r18 or higher. You can then enable
or re-enable the inspections by opening the Settings or Preferences
dialog and navigating to Editor > Inspections > C/C++ > General >
Clang-Tidy. When selecting this inspection in the Settings or
Preferences dialog, you can also see the list of Clang-Tidy checks
that are enabled and disabled under the Option section of the
right-most panel.
To disable the warnings just go to:
Preferences->Editor->Inspections->C/C++->General->Clang-tidy
and uncheck Clang-tidy or edit the list of checks to disable those that annoy you.
Related
I have several modules in Android Studio project, and I would like to change inspections settings for one of these modules. More precise, I want to turn off all Android-related inspections in one module, but leave all general Java inspections in place.
I need this because I have a not Android-specific Java library module, and that module uses java.util.Properties, and it's load method was implemented in Android API level 9. Since that library is not Andoid stuff, I have not specified Android API level at all, and Studio warns me about that.
It offers adding Android annotation to ignore that inspection, but adding Android dependency to turn off Android warning seems bad.
I can edit the settings to shitch that warning off, but I don't want to turn API level warnings in the whole project.
As I found, in settings you can specify inspection setting either globally or for whole project, not for specific module.
Is there a way to change inspections settings for one module, or do some hack around?
I am using Android Studio 1.3.2.
The Studio should automatically understand that the Java module has nothing with Android, and stopped Android inspections (but they were not disabled, though): I went fix something in the code, rebuilt it several times, and when I returned to warning line, it was clean.
So, I don't actually know what's going on,
but I got some recomendations, that should help:
Sync your Gradle project, it will try to rebuild the project. Some dependencies and settings will only resolve after Gradle will do something internal.
If Gradle will fail, there might be errors in code that ruins interspections. Try to solve them.
If your project history is stored in VCS, try checkout the latest clear version and sync project again.
Check changes in .iml files manually. For some reason, Studio sometimes does weirds edits there, and if I rollback some of them, Studio works better.
Actually you can disable particular inspections being made by Android Studio. However this needs to be on all projects you have in Android Studio, and cannot be done in all modules you are currently developing.
To disable android inspections on your projects follow these steps:
Click on the File menu and Select Settings
Expand the Editor root node select Inspections
There you will have all the inspections which Android Studio checks when building a project (image below). You can expand the Android node and check what you wish to remove from your inspections.
Hope this helps :)
While trying to debug a JNI project, I see this image after choosing "run" > "edit configuration": According to NDK documents I should see and be able to choose between lldb and GDB. Does anyone know how to do this on the new Android Studio? I am asking because I do not see my break points in my native code. Here is what I have:
Try that:
Open the sdk manager (Tools->android->sdk manager) then go in the tab "SDK Tools" and there check "LLDB".
Then:
Make sure you have selected a native run configuration (The default one is called "app-native"
Make sure you have selected a "Debug" variant (Bottom left, click on variant and select a "Debug")
Launch in debug (not the "play" green triangle, but the small bug on its right side)
This works for me with Android Studio 2.0 Preview, Gradle 2.9 and experimental plugin 0.6.0-alpha1
When I open android studio I am getting an error- "Error loading project: Cannot load 2 facets. When I clicked to see the error the following appeared
"2 facets cannot be loaded. You can mark them them as ignored to suppress this error notification.
Unknown facet type:'android', Unknown facet type:'android-gradle'
I tried to add facets ( In Project Structure > Project settings > Modules > clicked project name, then clicked Android as well as Android-Gradle) But both showed as "cannot load facet, unknown facet type." Under Project settings > Facets > both Android and Android-Gradle are displayed as 'Invalid facets'.
My project was running smoothly. This problem occured when I force-closed my laptop before exiting android studio as everything got stuck. After that whenever I open the android studio this problem occurs. I am not able to run my project. Can anyone please help me to solve this?
Just enable Android Support plugin.
Click Ctrl+Alt+S in Windows or Meta+Comma in Mac.
In top search bar type "plugin".
On right side it will show a list of plugins, find Android Support plugin, check it and click OK at the bottom of screen.
This is how it looks:
In Android Studio go to
File -> Settings - > Plugins -> Enable "Android Support" Plugin.
File, Then Settings->Plugin->Enable/Renable Plugin --> Apply --> Restart
This problem occured when i'd updated Android Studio.
In case nothing from other answers works, you don't have another option, except removing broken settings and making clean setup.
So what i am suggesting:
Use Settings Repository Feature to store personal IDE settings
close studio
remove .AndroidStudioX folder from user folder
re-launch studio, do not copy settings from previous version (because settings probably broken and auto-import couldn't import it well)
import personal settings from Settings Repository
For me I went to Settings -> Plugins and de-selected Gradle then immediately re-selected it. Android Studio then asked if I wanted to enable Groovy so I said yes and let it restart and now everything is happy again! (it was checked, but clearly somewhere deep down not truly enabled, so toggling the check-box sorted it)
Not sure if my cause was installing Flutter, but I did have to disable the Flutter plugin before I could build again.
I had the same problem with an ever-increasing number of facets - first 2, then 4, then 5 - and none of the above solutions worked. My solution (Android Studio 3.3, OS X) was to delete ~/Library/Preferences/AndroidStudio3.3/disabled_plugins.txt, which contained org.jetbrains.android and org.jetbrains.maven
I imagine if you have deliberately disabled plugins then you'll have to disable them again manually, but I was able to load all facets again.
Go To ->File->Settings->Plugins->disable/enable Android Support Plugins->Press Ok
Just re-enable Android Support plugin. Then it will ask to restart.
Restart them thats it
I faced this issue in Android Studio 3.2.1 I had to re-import my project after that it works.
I was facing this problem, I tried everything but nothing worked but then I remembered that I updated Android Studio just few hours back and then I enabled the plugins in the Android Studio and restarted it and it worked.
File -> Settings -> Plugin and then just press ok. It will ask to restart the android studio and please restart it.
For me I had to uncheck the plugin Android APK Support. I clicked Apply and then Ok to close the window. Android Studio prompted me to restart the program, and the program restarted. I checked the Android APK Support plugin again and restarted the program. And then I selected File -> Sync Project with Gradle Files
Then it worked just fine.
I have the Resharper 6.1 Full Edition but my Decompile Sources option is grey out or not available in the Navigate To context menu... what should i do?
You should probably go to ReSharper > Options > Tools > External Sources and configure settings in this page the way that would allow decompiling - for example, select an option different than Default Visual Studio navigation
Im a great fan of resharper, and used to use the stylecop for resharper plugin a while back.
I wanted to use it again today but the stylecop for resharper codeplex site says that stylecop for resharper is now integrated into stylecop.
So I installed stylecop (4.6), but my resharper (5.1) appears to be unchanged.
I particularly liked using the code formatting settings that were included in the stylecop for resharper package (I think the file was 'StyleCopCodeStyle.xml', which could be used in the resharper options to set the code formatting and cleanup behaviour) - this xml file is now gone.
Am I missing something. Theres zero doumentation about this stylecop/resharper marriage, and I clueless as to what I am actually getting
Can anyone shed some light on this ?
Just an update for ReSharper 9:
To install ReSharper & StyleCop together follow these steps:
Close all Visual Studio Applications (Important!!).
Install ReSharper by double clicking the executable and following the installation process. This step will require administration rights (most likely). The precise steps to follow are unknown as they are likely to be different in the trial versus full version.
Download the stylecop msi file from here: https://stylecop.codeplex.com/releases/view/79972
Install it by double clicking and following a standard install process.
NOTE: It might be required to move the install files into a different directory from C: because otherwise if the user does not have administration rights they will not be able to supress rules.
Open Visual studio and there should be a new menu item in the top menu bar called ReSharper. Select Extension Manager…
A new window should open with a list of all of the possible extensions for resharper. Search (top right of the window) for “ReSharper.StyleCop” and press the install button.
Follow the basic installation instructions for this add-on.
Restart visual studio.
All done!!
On the StyleCop project home page, it is quite clearly states that StyleCop 4.5 is the version that is compatible with Resharper 5.1.