Android studio NoClassDefFoundError - android.support.v7.app.AppCompatDelegateImplV14 - android-studio

I have upgraded my project from Eclipse to Android studio. I am getting the below error after the app launch
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
at com.lib.base.NBaseActionBarActivity.onCreate(NBaseActionBarActivity.java:39)
at com.app.home.HomeFragmentActivity.onCreate(HomeFragmentActivity.java:254)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
What cause this issue? i have added appcompat v7 into gradle as,
compile 'com.android.support:appcompat-v7:22.2.0'
Thanks in advance.

Related

android studio fail and exit after restore default settings

In order to make an imported project from eclipse into android studio to work, I follow a suggestion from stackoverflow article and do the following; 
file -> manage ide settings -> restore default settings
Then everytimes android studio starts and fail and exit with the following message. How to fix that?
Internal error. Please refer to https://code.google.com/p/android/issues
java.util.concurrent.CompletionException: com.intellij.diagnostic.PluginException: Fatal error initializing 'com.android.tools.idea.AndroidInitialConfigurator' [Plugin: com.intellij]
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:218)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:200)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:787)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:325)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:419)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: com.intellij.diagnostic.PluginException: Fatal error initializing 'com.android.tools.idea.AndroidInitialConfigurator' [Plugin: com.intellij]
at com.intellij.serviceContainer.ComponentManagerImpl.handleInitComponentError$intellij_platform_serviceContainer(ComponentManagerImpl.kt:423)
at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:60)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:110)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:64)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:57)
at com.intellij.serviceContainer.ComponentManagerImpl.createComponents(ComponentManagerImpl.kt:340)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$loadComponents$5(ApplicationImpl.java:348)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.application.impl.ApplicationImpl.loadComponents(ApplicationImpl.java:348)
at com.intellij.idea.ApplicationLoader$startApp$6$loadComponentInEdtFuture$1.run(ApplicationLoader.kt:198)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
... 23 more
Caused by: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/kapt/idea/KaptProjectResolverExtension
at com.android.tools.idea.projectsystem.gradle.DisableKaptProjectResolverExtensionInitializer.run(DisableKaptProjectResolverExtensionInitializer.kt:24)
at com.android.tools.idea.AndroidInitialConfigurator.activateAndroidStudioInitializerExtensions(AndroidInitialConfigurator.java:201)
at com.android.tools.idea.AndroidInitialConfigurator.<init>(AndroidInitialConfigurator.java:71)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:52)
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:771)
at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:35)
... 36 more
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.kapt.idea.KaptProjectResolverExtension PluginClassLoader(plugin=PluginDescriptor(name=Android, id=org.jetbrains.android, descriptorPath=plugin.xml, path=C:\Program Files\Android\Android Studio\plugins\android, version=2021.1.1 Patch 2, package=null), packagePrefix=null, instanceId=50, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:215)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 46 more
-----
Your JRE: 11.0.11+9-b60-7590822 amd64 (Oracle Corporation)
C:\Program Files\Android\Android Studio\jre
I had the same problem after restore default settings (android studio bumblebee patch 2).
I had to uninstall my android studio, if you don't see uninstall.exe on your android studio folder, you can download older version of android studio, and paste uninstall.exe on your root folder, then just uninstall. Refer to this
And download Android Studio Arctic Fox (2020.3.1) Patch 4.
In my case, the problem is solved.

problem in linux A JNI error has occurred linux

I have downloaded burpsuite pro version but I got this error while using this command
java -javaagent:BurpSuiteLoader_v2021.3.2.jar -noverify -jar burpsuite_pro_v2021.3.2.jar
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: burp/StartBurp has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)

Error while installing Android Studio in Ubuntu 16.04

I am trying to install android studio in ubuntu 16.04 LTS.
I downloaded the latest release and installed jdk using
sudo apt install openjdk-9-jre-headless
After the above step I am trying to run ./studio.sh after extracting Android studio zip file but It is giving me the following error. Please help.
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:96)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:93)
... 1 more
Caused by: java.lang.ExceptionInInitializerError
at com.intellij.openapi.application.ApplicationNamesInfo.getInstance(ApplicationNamesInfo.java:49)
at com.intellij.ui.AppUIUtil.getFrameClass(AppUIUtil.java:127)
at com.intellij.ui.AppUIUtil.updateFrameClass(AppUIUtil.java:120)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:114)
at com.intellij.idea.MainImpl.start(MainImpl.java:34)
... 6 more
Caused by: java.lang.RuntimeException: Cannot load resource: /idea/AndroidStudioApplicationInfo.xml
at com.intellij.openapi.application.ApplicationNamesInfo.<init>(ApplicationNamesInfo.java:59)
at com.intellij.openapi.application.ApplicationNamesInfo.<init>(ApplicationNamesInfo.java:30)
at com.intellij.openapi.application.ApplicationNamesInfo$ApplicationNamesInfoHolder.<clinit>(ApplicationNamesInfo.java:43)
... 11 more
Caused by: java.io.FileNotFoundException: /idea/AndroidStudioApplicationInfo.xml
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:351)
at com.intellij.openapi.application.ApplicationNamesInfo.<init>(ApplicationNamesInfo.java:55)
... 13 more
I saw similar problem on StackOverflow. Please, do not install Java 9 before previous would be officially deprecated. This version is still in sdevelopment process and might be highly unstable
Unistall openJdk-9 and install Oracle-jdk-8 following this post:
http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Lighttable -simplest working groovy file - exception

I installed Light table in 0.7.2 for linux x64(Ubuntu 14.04).
I installed plugin Groovy 0.0.7
I stored in file test.groovy
println (1..10)
When I try to evaluate it(ctrl+enter) i got
We couldn't connect. Looks like there was an issue trying to connect to the project. Here's what we got:
null
null
find: `/usr/bin/../embeddable': No such file or directory
Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 13 more
I am new to Lighttable, how could I fix it ?
Reinstall the plugin and check where it is being installed would be the quickest route. The other alternative is to embed the plugin into the project which would take you a bit of extra time.
Here would be the two quickest suggestions:
Pull the plugin out. Then do git clean -fdx and be sure the plugin is gone. Then reinstall from scratch.
Find where the plugin is located. By default, clojure and groovy typically are located at LightTable/deploy/plugins. If it is, then this is easy, do a git pull on the directory because the .jar may not be in the same location as the plugin itself.
Try number 1 first. It is simpler and faster to accomplish.

How to package JavaFx application

I use Eclipse and efxclipse plugin. I made a very simple JavaFx application following oracle documentation. My jdk version is jdk1.7-045. I notice that export application as a normal jar is different from normal Java application. What about if I want to make a normal jar file, and could be executed by double click jar file? Any hints.
D:\temp>java -classpath ./jfxrt.jar -jar Fxhello.jar
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Ap
plication
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 13 more
-classpath and -jar can not be used together
You can edit the classpath in the MANIFEST.MF of your jar file. The MANIFEST.MF will look like:
Manifest-Version: 1.0
Class-Path: jfxrt.jar
Then, you can run your application as
java -jar Fxhello.jar

Resources