Search code examples
androidandroid-studiointellij-ideaandroid-roomintellij-inspections

Where to delete or reset Inspection Profile in Android Studio?


I am trying to undo a mistake of suppressing a lint warning but I can't really find it in the Inspection Settings in Android Studio. I already reset the Android Studio, invalidate cache, and clean the build but it still not resetting the lint. There is no annotation added to the code yet the warning was suppressed. What I really want to do is to add the @Suppress annotation in the code not in the IDE's or project profile which makes it hidden to developer.

enter image description here

The code I am trying to return the old lint inspection is this

@ProvidedTypeConverter
class AppTypeConverter(private val jsonParser: JsonParser) {

    @TypeConverter
    fun fromMetricsJson(jsonString: String): MetricsEntity {
        return jsonParser.fromJsonString(jsonString, MetricsEntity::class.java)
            ?: MetricsEntity()
    }

    @TypeConverter
    fun toMetricsJson(obj: MetricsEntity): String {
        return jsonParser.toJsonString(obj, MetricsEntity::class.java)
            ?: ""
    }

    @TypeConverter
    fun fromMetricsMinJson(jsonString: String): MetricsMinEntity {
        return jsonParser.fromJsonString(jsonString, MetricsMinEntity::class.java)
            ?: MetricsMinEntity()
    }

    @TypeConverter
    fun toMetricsMinJson(obj: MetricsMinEntity): String {
        return jsonParser.toJsonString(obj, MetricsMinEntity::class.java)
            ?: ""
    }

}

This method toMetricsMinJson is not being used by Room's generated code since I do not used it to store data but Room still requires it to be added in build else this error.

Cannot figure out how to save this field into database. You can consider adding a type converter for it.

I cannot find it suppressed settings in lint inspection profile and I also cannot locate any inspection related file in ~/Library/Application Support/Google/AndroidStudio2022.3.

Switching between IDE and Project Profile does not fix it as well.

enter image description here

enter image description here

enter image description here

UPDATE

I found a cue in others.xml file and tried to delete it but the lint still not return.

enter image description here


Solution

  • This is not a perfect solution but it works:

    It sounds like something related to developer.android.com/training/data-storage/room, however, it might be something not about inspections(in fact I've searched all codes in IDEA but can't find these error messages), so in this case, I can only provide a workaround:

    Exit Android Studio first, then delete /Users/yourname/Library/Application Support/Google/AndroidStudio2022.3 and /Users/yourame/Library/Caches/Google/AndroidStudio2022.3, this will reset the installation to defaults, and start the IDE again.

    These two folders are Configuration (idea.config.path) and System (idea.system.path) in case you are running in other operation systems such as Linux, Windows, more info about directories used by the IDE: https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#clean-up-old-ide-dirs