Message Boards
Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
New Member Posts: 17 Join Date: 6/4/15 Recent PostsHi All,
I am using com.liferay.portal.kernel.util package in my portlet in liferay 7.1.
but at deployment time i am getting below error in gogo shell console.
Unresolved requirement: Import-Package: com.liferay.portal.kernel.util; version="[7.0.0,8.0.0)".
below is my build.gradle
dependencies {
compileOnly group:
"com.liferay.portal", name:
"com.liferay.portal.kernel", version:
"2.0.0"
compileOnly group:
"com.liferay.portal", name:
"com.liferay.util.taglib", version: "2.0.0"
compileOnly group: "javax.portlet", name:
"portlet-api", version: "2.0"
compileOnly group: "javax.servlet", name:
"javax.servlet-api", version: "3.0.1"
compileOnly group: "jstl", name: "jstl", version:
"1.2"
compileOnly group: "org.osgi",
name: "osgi.cmpn", version: "6.0.0"
}
Thanks in advance !
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
Liferay Legend Posts: 1228 Join Date: 4/14/08 Recent Poststry to remove the line:
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
and if you use maven add the following dependency:
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
Just make sure that as the result of the build the META-INF/MANIFEST.MF file contains the following line in the Import-Package: section:
com.liferay.portal.kernel.model;version="[2.0,3)"
It gets much trickier if you want the same module to work on 7.0 and 7.1, your build must produce the following entry in the manifest:
com.liferay.portal.kernel.model;version="[1.0,3)"
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
New Member Posts: 17 Join Date: 6/4/15 Recent PostsThanks Victor, it is working for me after changed version of com.liferay.portal.kernel
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
New Member Posts: 20 Join Date: 12/15/12 Recent PostsConfirmed. I also had the same error and changing the version from 2.0.0 to 3.0.0 fixed it
Thanks!
Sean
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
Junior Member Posts: 77 Join Date: 7/4/14 Recent PostsRE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
New Member Posts: 5 Join Date: 12/7/17 Recent PostsRE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
New Member Post: 1 Join Date: 11/7/19 Recent PostsUnresolved requirement: Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc; version="[1.6.0,2.0.0)"_ [Sanitized].Even though i have made below changes in version as per Victor's suggestion.<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.util.taglib</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
Junior Member Posts: 79 Join Date: 12/9/11 Recent PostsChanging the kernel version doesn't seem to resolve the problem. What causes this error on the runtime?
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
New Member Post: 1 Join Date: 4/20/20 Recent Postsat org.eclipse.osgi.container.Module.start(Module.java:429)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
Can AnyBody please help
RE: Unresolved requirement: Import-Package: com.liferay.portal.kernel.util;
Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent PostsUpgrade to GA7 (or better, a newer version), then patch, then try again.
Hi All , I am using Liferay 7.0.3 CE GA4 and my gradle version is 5.6 ,I created a service builder project did buildService and when deploying to tomcat it gives me error as follows: Unresolved requirement: Import-Package: com.liferay.portal.kernel.dao.db; version="[7.5.0,8.0.0)"_
Alternatively: How do you build (e.g. what are the dependencies you declare)? This version resolution is done compiletime, but fails at runtime. If your build-environment points to a different version than your runtime environment, you'll run into this kind of mismatch.