Adding Metadata-extractor library in Android Studio
Asked Answered
U

1

5

I am trying to add metadata-extractor-2.8.1.jar in my android studio project.

But every time i hit "Add As Library" jar file doesn't add. Only Logs a Null pointer exception.

Below is the exception message:

java.lang.NullPointerException
    at com.android.tools.idea.actions.CreateLibraryFromFilesAction$CreateGradleLibraryFromFilesDialog.<init>(CreateLibraryFromFilesAction.java:152)
    at com.android.tools.idea.actions.CreateLibraryFromFilesAction.actionPerformed(CreateLibraryFromFilesAction.java:90)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:266)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:926)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:236)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:105)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:512)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
    at java.awt.Component.processMouseEvent(Component.java:6525)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6290)
    at java.awt.Container.processEvent(Container.java:2234)
    at java.awt.Component.dispatchEventImpl(Component.java:4881)
    at java.awt.Container.dispatchEventImpl(Container.java:2292)
    at java.awt.Component.dispatchEvent(Component.java:4703)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
    at java.awt.Container.dispatchEventImpl(Container.java:2278)
    at java.awt.Window.dispatchEventImpl(Window.java:2739)
    at java.awt.Component.dispatchEvent(Component.java:4703)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
    at java.awt.EventQueue.access$400(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.awt.EventQueue$3.run(EventQueue.java:691)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:719)
    at java.awt.EventQueue$4.run(EventQueue.java:717)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

I have the metadata-extractor-2.6.4.jar added to my project and it works fine. But i really need the upgrades brought by 2.8.1.

Any help is very much appreciated! Also, thanks in advance :)

Unarmed answered 6/9, 2015 at 7:41 Comment(0)
N
8

Use the maven dependency, and add it like this

compile 'com.drewnoakes:metadata-extractor:2.8.1'

http://mvnrepository.com/artifact/com.drewnoakes/metadata-extractor/2.8.1

Nuthatch answered 6/9, 2015 at 9:40 Comment(4)
Its already in my compile file list. But this .jar file is getting exception while i add it in the Libs. So the jar is not even available for compilation i guess.Unarmed
Tried just copy/paste it in, or just drag it in? If nothing of the suggested works, try downloading it again, or try an older version to see.Nuthatch
As i mentioned in my post. I really need the newer version of the .jar file.Unarmed
thanks for your reply. later i tried remote dependency as you mentioned. But failed to build Gradle. Surprisingly later when i switched back to local dependency again (removing remote dependency): compile fileTree(include: '*.jar', dir: 'libs') It worked! Don't really know what happened -_-Unarmed

© 2022 - 2024 — McMap. All rights reserved.