Android Studio : IDE shows fatal error when adding a new activity to the existing project - android-studio-2.3

Studio Build: 2.3.1
Version of Gradle Plugin:2.3.1
Version of Gradle:3.3
Version of Java: OpenJDK Platform8 version 8.0.1120.6
OS: windows 10
Steps to Reproduce:
1. Open https://github.com/udacity/ud851-Exercises/tree/student/Lesson04a-Starting-New-Activities/T04a.01-Exercise-AddNewActivity as an existing project in android studio.
When adding a new activity sometimes i get nullpointerexception and nothing visual happens, and some other times i get a create new activity wizard which, after clicking the Finish button, freezes and i get InvalidRefrenceException.
I've tried to add a new activity several times and after each attempt i got nullPointerException. On last attempt, however, the wizard showed up but after clicking the finish button, it froze and i got IllegalStateException.
Also when I open Android SDK manager, the SDK Tools and other tab, all the versions of sdk as well as the show details box at the bottom are unclickable.
here is the log text:
null
java.lang.NullPointerException
at com.android.tools.idea.actions.NewAndroidComponentAction.actionPerformed(NewAndroidComponentAction.java:121)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:197)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:156)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:211)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$2(ActionMenuItem.java:304)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:905)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:284)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:112)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
at com.intellij.openapi.application.TransactionGuardImpl.access$300(TransactionGuardImpl.java:40)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:113)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:123)
at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:109)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:112)
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
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)

This happened to me as well but only when creating the activity from the activity list. If you create the new activity from the Gallery this doesn't happen.
You find gallery here: File->New->Activity->Galery
https://i.stack.imgur.com/Fm4a3.jpg

Related

How to prevent this error ? Vcl.Forms.hpp(925): E2316 'FMenu' is not a member of 'TCustomForm'

My project started to throw that error suddenly even though i dont use FMenu. I created a new empty project and tried to build it but got the same error. I didn't even add anything to the form just created new project and tried to build. I am using classic borland compiler on the project options btw.
Interesting side is that error coming from a library file Vcl.Forms.hpp. I dont know what to do. Here is the line that error navigated me when i click on it.
In Vcl.Forms.hpp Line 925;
__property Vcl::Menus::TMainMenu* Menu = {read=FMenu, write=SetMenu, stored=IsForm};

Problem with zabbix-fronend-php in maps after upgrade

I upgraded zabbix-frontend-php to last stable version (4.0.0) and get error in map.
In map i see only first element. In browser console i see next error:
TypeError: can't convert null to object jsLoader.php:2049:2
SVGElement.prototype.update http://zabbix.HOST/jsLoader.php:2049:2
SVGElement.prototype.create http://zabbix.HOST/jsLoader.php:2158:3
SVGElement http://zabbix.HOST/jsLoader.php:1980:3
SVGCanvas.prototype.createElement http://zabbix.HOST/jsLoader.php:1337:13
SVGTextArea.prototype.create http://zabbix.HOST/jsLoader.php:1753:17
SVGCanvas.prototype.createElement http://zabbix.HOST/jsLoader.php:1334:13
SVGElement.prototype.add http://zabbix.HOST/jsLoader.php:2015:16
SVGMapShape.prototype.update http://zabbix.HOST/jsLoader.php:3370:3
SVGMap.prototype.updateOrderedItems/< http://zabbix.HOST/jsLoader.php:2612:3
forEach self-hosted:268:13 SVGMap.prototype.updateOrderedItems http://zabbix.HOST/jsLoader.php:2607:2
SVGMap.prototype.update/< http://zabbix.HOST/jsLoader.php:2693:3
ImageCache.prototype.invokeCallback http://zabbixHOST/jsLoader.php:1847:3
ImageCache.prototype.handleCallback http://zabbix.HOST/jsLoader.php:1866:3
ImageCache.prototype.onImageLoaded http://zabbix.HOST/jsLoader.php:1878:2
ImageCache.prototype.preload/</image.onload http://zabbix.HOST/jsLoader.php:1935:4
I see this error at Forum zabbix , but it is not resolved.
For temporary solve this problem, i'm downloaded last zabbix-frontend-php from git (from trunk, 1.0.14 version) and was updated frontend. I'm not watching this error....

Rejecting re-init on previously failed class error when loading a Class with dalvikvm

I am trying to use Terminal IDE on Lollipop 5.1.1. Using a Samsung E7 device, a mod version of Terminal IDE is provided by someone on XDA
here:
http://forum.xda-developers.com/showthread.php?t=1340852&page=7
I tried to use javac script in that mod but it gave an unsatisfied link error, saying that:
$ javac
java.lang.UnsatisfiedLinkError: org.apache.harmony.security.fortress.Services
at org.apache.harmony.security.fortress.Engine.getServices(Engine.java:158)
at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:137)
at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:90)
at
org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.java:83)
at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:294)
at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:268)
at java.util.jar.JarFile.getInputStream(JarFile.java:380)
at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
at java.net.URL.openStream(URL.java:470)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:515)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:228)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:112)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:97)
at com.sun.tools.javac.main.Main.bugMessage(Main.java:434)
at com.sun.tools.javac.main.Main.compile(Main.java:421)
at com.sun.tools.javac.main.Main.compile(Main.java:308)
at com.sun.tools.javac.main.Main.compile(Main.java:299)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.spartacusrex.spartacuside.external.javac.main(javac.java:13)
$
It is strange that there is a UnsatisfiedLinkError , because it doesn't say that VM cannot find xyz.so library or cannot find xyz method.
I tried using logcat command right after using Terminal IDE's javac script on Device, the odd thing I found from there is :
I/art ( 6558) : rejecting re-init on previously-failed class java.lang.Class<org.apache.harmony.security.fortress.Services>
I couldn't understand why this happened,
The javac script uses android's dalvikvm command to load
com.spartacusrex.spartacuside.external.javac
class. People have faced this rejecting re-init issue on sdk version 20+ but it's not clear to me why this info message uccurs and how to solve it.
I copied /system/lib/libjavacrypto.so to Terminal IDE's ~/system/lib folder and now javac and dx tools are working.
It seems like Google messed up with things in /system/lib which resulted in errors.
Answering so someone else might find it useful.

Target Unreachable, identifier 'xxxBean' resolved to null when running JasperReports 6.0.1

I have an application that was working fine until I added code to run a JasperReport. The error is the well known
Target Unreachable, identifier 'studentBean' resolved to null
After adding the code needed to run a JasperReport, the particular page that uses that bean (StudenBean) started to show such an exception before it even shows. After a process of commenting/uncommenting lines of code, I could isolate de precise line that brings the problem. It's shown below:
private void gerarRelatorioPDF(List<Student> students, InputStream report, OutputStream pdf) {
JRDataSource jrds = new JRBeanCollectionDataSource(students);
try {
JasperRunManager.runReportToPdfStream(report, pdf, null, jrds); // <<-- Here!!!
} catch (Exception e) {
e.printStackTrace();
}
}
It's the line that generates a PDF stream from a JasperReport definition. This method is private because it's called by another public method. The public method is the action of a <p:commandButton/> in the page, so this button is not even being clicked, because the exception prevents the page to render.
If I comment that line of code, the page renders ok and I can click the button, but obviously no report will be generated.
Any ideas how to fix it?
After some study, I decided to modify my POM.xml (Maven script) to include JasperReports 6.0.0. Previously I had only installed JasperReports 6.0.1 plugin in Eclipse, created and configured the report.
When we add a new report to a project, Eclipse automatically adds the path to JasperReports libraries to the class path, so the project compiles fine, but it seems that some other dependencies are not added and, specially, not deployed to the application server (in my case JBoss AS 7.1).
After updating the POM.xml to include JasperReports, everything started to work as desired.

CreateWindowEx fails with error 1407 CLASS_NOT_REGISTERED for the second instance of ActiveX

Hi
I'm working on some legacy code - ATL ActiveX used as "installer" downloads files from the server for later installation.
There is a "progress bar window" that works fine.
The problem is when I start another instance of the ActiveX in the same process (Windows XP IE7), the progress bar is not installed for the second instance.
::CreateWindowEx(0L, PROGRESS_CLASS, EMPTY_STRING, WS_CHILD | WS_VISIBLE, X, (2*Y)-m_nProgHeight, nWidth - 2*X, m_nProgHeight, m_hWnd, NULL, _Module.GetModuleInstance(), NULL);
So I'm getting error 1407 CLASS_NOT_REGISTERED.
The only place where I find some code related to the registration is in DLLMain (this is also my concern)) For attach case:
WNDCLASS wc;
memset(&wc,0,sizeof(wc));
::GetClassInfo(hInstance, "#32770", &wc);
wc.lpszClassName = "XXXXXWindow";
RegisterClass(&wc);
Thank you
OK, what I found is:
- When IE started it loads two comctl32.dll - version 5.xxx and version 6.xxxxx.
Some how after the first instance of activeX finished it's run (deployment) I see that only version 6.xxxx of comctl32.dll left loaded.
Adding InitCommonControlsEx() did not helped, since for the second run the dll was already unloaded, that actually caused the crash of IE.
When I added explicitly LoadLibrary(comctl32.dll) it solved the issue.
If anyone knows what could cause the unload of version 5.xxxx please comment here.
Thank you.

Resources