gradle/gradle · error · RuntimeException

Unable to create output stream for file %s.

Error message

Unable to create output stream for file %s.

What it means

Gradle throws this error when the following condition is violated: Unable to create output stream for file <value>.

Source

Thrown at platforms/core-configuration/file-operations/src/main/java/org/gradle/api/internal/file/archive/compression/SimpleCompressor.java:31

 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.gradle.api.internal.file.archive.compression;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;

public class SimpleCompressor implements ArchiveOutputStreamFactory {

    @Override
    public OutputStream createArchiveOutputStream(File destination) {
        try {
            return new FileOutputStream(destination);
        } catch (Exception e) {
            String message = String.format("Unable to create output stream for file %s.", destination);
            throw new RuntimeException(message, e);
        }
    }
}

View on GitHub (pinned to 534f27719b)

Solutions

  1. Review the values passed to this API and correct the invalid input described in the error message.

When it happens

Trigger: Thrown at platforms/core-configuration/file-operations/src/main/java/org/gradle/api/internal/file/archive/compression/SimpleCompressor.java:31 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22). Data as JSON: /api/errors/85507f989cd4e768. Report an issue: GitHub.