Message Boards

Err- Unresolved requirement: Import-Package: com.liferay.portal.kernel.util

Upender Kashyap, modified 3 Years ago.

Err- Unresolved requirement: Import-Package: com.liferay.portal.kernel.util

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts
Hello Everyone , I am trying to develop a custom app using Liferay DXP 7.2.1. While I am trying to deploy my service module, I am getting below error on console:

2020-09-09 13:27:18.948 ERROR [Framework Event Dispatcher: Equinox Container: 9cb6992f-e123-4cc3-9be5-07a2bda02701][Framework:93] FrameworkEvent ERROR 
org.osgi.framework.BundleException: Could not resolve module: com.liferay.service.portal.service [1101]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.util; version="[9.13.0,10.0.0)"_ [Sanitized]
    at org.eclipse.osgi.container.Module.start(Module.java:444)

My  build.gradle files is having:
dependencies {
    compileOnly group: "com.liferay", name: "com.liferay.petra.io"
    compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
    compileOnly group: "com.liferay", name: "com.liferay.petra.string"
    compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api"
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
    compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
    compileOnly group: "org.osgi", name: "org.osgi.core"
    compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
    compileOnly project(":modules:formservice:formservice-api")
    
}buildService {
    apiDir = "../formservice-api/src/main/java"
}group = "com.liferay.service.portal"

I tried various solutions mentioned in other threads mentioning same error but still not luck. Can anyone please let me know the exact cause for this and some fix to this error.Thanks in advance!!