Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symbol 'IllegalArgumentException' is inaccessible from here

I have two projects in Android studio: model and app.
model is written completely in java, graddle file starts with apply plugin: 'java'
app is written in android-java and depends on model. The graddle file starts with apply plugin: 'com.android.application'

I can insert this snippet:

/**
 * Debugging
 *
 * @throws IllegalArgumentException
 *             if illegal == true
 */
private void debug(boolean illegal){
    if (illegal)
        throw new IllegalArgumentException("tu");
}

anywhere in app and there are no errors. However when I insert it anywhere in model I get an error: Symbol 'IllegalArgumentException' is inaccessible from here and upon clicking 'more'
Inspection info: This inspection points out unresolved references inside javadoc
I can however compile, run without problems.

My Android-studio version is 3.4. I do not remember having this problem with the version I used before but I'm not sure which version that was.

like image 904
peer Avatar asked May 20 '19 11:05

peer


1 Answers

I believe there is nothing wrong with your code. I can see the same error in my project. There is a bug in Android Studio (IntelliJ Idea), an issue has already been created: Javadoc inspection "Declaration has problems in Javadoc reference" wrongly marks types as inaccessible. So the only option is either switching off the check, or ignoring the error unless you suffer from OCD.

like image 154
Miloš Černilovský Avatar answered Nov 15 '22 18:11

Miloš Černilovský