Problem compiling Flex project from Flash Builder - apache-flex

I'm having a problem with Adobe Flash Builder, when trying to compile and run a Flex Project I had previously coded outside FB.
I imported the classes following the correct package file system, and everything seemed to work correctly: none of the classes shows errors (and if I code something wrong, an error is shown, so FB error system is working), the auto-complete works fine in all classes, the Main.xmxl class is set up as 'default Application' in the project...
Maybe I skipped a step in between or something, but I always get the following error when trying to compile:
Error
Sun Jun 19 18:40:32 CEST 2011
Uncaught exception in compiler
java.lang.NullPointerException
at flex2.compiler.mxml.lang.StandardDefs.isIUIComponent(StandardDefs.java:784)
at flex2.compiler.mxml.builder.ComponentBuilder.constructComponent(ComponentBuilder.java:177)
at flex2.compiler.mxml.builder.ComponentBuilder.analyze(ComponentBuilder.java:84)
at flex2.compiler.mxml.dom.Node.analyze(Node.java:53)
at flex2.compiler.mxml.builder.VectorBuilder$ElementNodeHandler.componentNode(VectorBuilder.java:173)
at flex2.compiler.mxml.lang.ValueNodeHandler.invoke(ValueNodeHandler.java:73)
at flex2.compiler.mxml.builder.VectorBuilder.processChildren(VectorBuilder.java:142)
at flex2.compiler.mxml.builder.VectorBuilder.analyze(VectorBuilder.java:97)
at flex2.compiler.mxml.dom.VectorNode.analyze(VectorNode.java:50)
at flex2.compiler.mxml.builder.AbstractBuilder$RValueNodeHandler.vectorNode(AbstractBuilder.java:999)
at flex2.compiler.mxml.lang.ValueNodeHandler.invoke(ValueNodeHandler.java:113)
at flex2.compiler.mxml.builder.AbstractBuilder$RValueNodeHandler.process(AbstractBuilder.java:975)
at flex2.compiler.mxml.builder.AbstractBuilder.processRValueNodes(AbstractBuilder.java:941)
at flex2.compiler.mxml.builder.AbstractBuilder.processPropertyNodes(AbstractBuilder.java:770)
at flex2.compiler.mxml.builder.AbstractBuilder.processPropertyNodes(AbstractBuilder.java:741)
at flex2.compiler.mxml.builder.ComponentBuilder$ComponentChildNodeHandler.property(ComponentBuilder.java:506)
at flex2.compiler.mxml.lang.ChildNodeHandler$CoreDeclarationHandler.property(ChildNodeHandler.java:208)
at flex2.compiler.mxml.lang.DeclarationHandler.invoke(DeclarationHandler.java:94)
at flex2.compiler.mxml.lang.ChildNodeHandler$CoreDeclarationHandler.invoke(ChildNodeHandler.java:236)
at flex2.compiler.mxml.builder.ComponentBuilder$ComponentChildNodeHandler.invoke(ComponentBuilder.java:705)
at flex2.compiler.mxml.lang.ChildNodeHandler.scanChildNodes(ChildNodeHandler.java:79)
at flex2.compiler.mxml.builder.ComponentBuilder.processChildren(ComponentBuilder.java:437)
at flex2.compiler.mxml.builder.ComponentBuilder.analyze(ComponentBuilder.java:88)
at flex2.compiler.mxml.dom.Node.analyze(Node.java:53)
at flex2.compiler.mxml.builder.DocumentBuilder$NestedDeclarationNodeHandler.componentNode(DocumentBuilder.java:792)
at flex2.compiler.mxml.lang.ValueNodeHandler.invoke(ValueNodeHandler.java:73)
at flex2.compiler.mxml.builder.DocumentBuilder$DocumentChildNodeHandler.processNestedDeclaration(DocumentBuilder.java:716)
at flex2.compiler.mxml.builder.ComponentBuilder$ComponentChildNodeHandler.nestedDeclaration(ComponentBuilder.java:616)
at flex2.compiler.mxml.builder.DocumentBuilder$DocumentChildNodeHandler.invoke(DocumentBuilder.java:763)
at flex2.compiler.mxml.lang.ChildNodeHandler.scanChildNodes(ChildNodeHandler.java:79)
at flex2.compiler.mxml.builder.ComponentBuilder.processChildren(ComponentBuilder.java:437)
at flex2.compiler.mxml.builder.DocumentBuilder.analyze(DocumentBuilder.java:188)
at flex2.compiler.mxml.dom.Node.analyze(Node.java:53)
at flex2.compiler.mxml.ImplementationCompiler.parse1(ImplementationCompiler.java:183)
at flex2.compiler.mxml.MxmlCompiler.parse1(MxmlCompiler.java:179)
at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2872)
at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2825)
etc...
Any guesses? I'm really getting mad with it...
Help would be greatly appreciated :)

Related

Firebase Analytics API StatusRunTimeException with XdsInitializationException

My problem - when start runReportRequest catched exeptions: StatusRunTimeException, XdsInitializationException. It is problem exist only when start jar-file, and when start in IDE that's ok and problem doesn't exist. Full log error:
янв. 08, 2023 8:49:41 PM io.grpc.internal.ManagedChannelImpl$NameResolverListener handleErrorInSyncContext
WARNING: [Channel<1>: (analyticsdata.googleapis.com:443)] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Failed to initialize xDS, cause=io.grpc.xds.XdsInitializationException: Cannot find bootstrap configuration
Environment variables searched:
GRPC_XDS_BOOTSTRAP
GRPC_XDS_BOOTSTRAP_CONFIG
`Java System Properties searched:
io.grpc.xds.bootstrap
io.grpc.xds.bootstrapConfig
at io.grpc.xds.BootstrapperImpl.bootstrap(BootstrapperImpl.java:110)
at io.grpc.xds.SharedXdsClientPoolProvider.getOrCreate(SharedXdsClientPoolProvider.java:87)
at io.grpc.xds.XdsNameResolver.start(XdsNameResolver.java:179)
at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:418)
at io.grpc.internal.ManagedChannelImpl$RealChannel$2.run(ManagedChannelImpl.java:981)
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95)
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127)
at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:978)
at com.google.api.gax.grpc.GrpcChannelUUIDInterceptor.interceptCall(GrpcChannelUUIDInterceptor.java:52)
at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
at com.google.api.gax.grpc.GrpcHeaderInterceptor.interceptCall(GrpcHeaderInterceptor.java:80)
at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
at com.google.api.gax.grpc.GrpcMetadataHandlerInterceptor.interceptCall(GrpcMetadataHandlerInterceptor.java:54)
at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:920)
at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63)
at com.google.api.gax.grpc.ChannelPool$AffinityChannel.newCall(ChannelPool.java:514)
at com.google.api.gax.grpc.ChannelPool.newCall(ChannelPool.java:143)
at com.google.api.gax.grpc.GrpcClientCalls.newCall(GrpcClientCalls.java:99)
at com.google.api.gax.grpc.GrpcDirectCallable.futureCall(GrpcDirectCallable.java:60)
at com.google.api.gax.grpc.GrpcUnaryRequestParamCallable.futureCall(GrpcUnaryRequestParamCallable.java:65)
at com.google.api.gax.grpc.GrpcExceptionCallable.futureCall(GrpcExceptionCallable.java:64)
at com.google.api.gax.rpc.AttemptCallable.call(AttemptCallable.java:87)
at com.google.api.gax.rpc.RetryingCallable.futureCall(RetryingCallable.java:63)
at com.google.api.gax.rpc.RetryingCallable.futureCall(RetryingCallable.java:41)
at com.google.api.gax.tracing.TracedUnaryCallable.futureCall(TracedUnaryCallable.java:75)
at com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126)
at com.google.api.gax.rpc.UnaryCallable.futureCall(UnaryCallable.java:87)
at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
at com.google.analytics.data.v1beta.BetaAnalyticsDataClient.runRealtimeReport(BetaAnalyticsDataClient.java:672)
at ru.vkcleanlite.ApplicationKt.getRealtimeReport(Application.kt:87)
at ru.vkcleanlite.ApplicationKt$startRequests$1.run(Application.kt:135)
}
com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: Failed to initialize xDS`
Initialization:
BetaAnalyticsDataClient.create().use { analyticsData ->
val request = RunRealtimeReportRequest.newBuilder()
.setProperty("properties/$propertyId")
.addDimensions(Dimension.newBuilder().setName("city"))
.addMetrics(Metric.newBuilder().setName("activeUsers"))
.build()
val response = analyticsData.runRealtimeReport(request)
}
How, I see, need add environment variables GRPC_XDS_BOOTSTRAP GRPC_XDS_BOOTSTRAP_CONFIG, but where get this is files? Official guide shared links on Git, where source link unsaffed, browser denied. But in this time, I'm not sure, what problem in environment variable, because in IDE that's all work, and in quick start (offical firebase guide for GA4) not contains information about settings for grps-connection. Pehraps, my research incorrect and problem another. For now updated grpc, but it not fixed problem. How it fixed? Thanks!

Qt moc error 1 - what does it mean?

I'm trying to build a project on Mac OSX, and it's giving me a cryptic error:
[moc_droparea.cpp] Error 1
droparea.cpp is (obviously) a file in the project. I checked that it exists in the project directory and is not corrupted. The file moc_droparea.cpp doesn't show up in the build folder after this error, so I'm assuming it's failing to build for whatever reason, but the error is too vague to help me figure out what's going on. Could anyone help me figure out what this means please?
Click on "compile output", scroll up and click the red line.
In my case the Red line was saying: You cant define an integer value in private slots..
Under the qt creator window, in "progress details" section, there is a button named "compile output" (button number 4). Errors are explained there with red font. Click it and scroll up.
The solution was annoyingly simple. I had a folder structure that put spaces (illegal characters) in the file path. I put underscores instead of spaces and it built fine. I would think the moc pre-processor could handle spaces in file names, but apparently not. I feel foolish, but at least the problem is solved now.
Hopefully this solution can help someone else.
This can be because of few other things as others have mentioned. I would like to add another one which is missing here.
You will get a "moc error 1" in case you create a class and add Q_OBJECT to it but do not inherit from QObject.
If you take a look at Compile Output there is a line saying:
Error: Class contains Q_OBJECT macro but does not inherit from QObject
Hence, the general approach to fix this problem is just taking a look at "Compile Output" window.
This can be because of many things I guess - I had a similar situation where I forgot to remove an entry in the .qrc file that didn't exist anymore.
So check your resource paths as well.
You can right click on the error 1 and select 'View output'. In my case, I had a bad file name in my qrc file.
Like J.Javan already pointed to, it might be helpful to check also the compiler output. In my case I found:
../stateMaschine/usermenu.h:57: Error: Class declarations lacks
Q_OBJECT macro. make: *** [Makefile:215: moc_usermenu.cpp] Error 1
So this helped me to fix the error by correction of the class declaration when using signals and slots:
class Menu : public QObject{
Q_OBJECT
...
Same Error 1 occured to me due to a ressource file (.qrc) which referred to a file name beginning with a period. When I removed the period from the file name, compilation worked again. Interestingly, the error only occured under Mac OSX using the Clang compiler. On Windows using the gcc compiler, the file name did not provoke an error.
Maybe the "[source file name] Error 1" message in general means that a file could not be found due to unexpected characters in the file path.
In my case, I ran out of space on SD card causing this sort of error.

Flex compile problem with as3httpclient

I am having trouble getting a Flex application (with as3httpclient) to work.
I compiled it (compc -load-config=build-swc.xml), put the as3httpclientlib-1_0_6.swc in my libs dir, and ran
mxmlc -compiler.include-libraries lib/as3crypto-1_3_patched.swc
lib/as3httpclientlib-1_0_6.swc lib/corelib.swc -- App.mxml
In my actionscript I
import org.httpclient.HttpClient;
but still I receive the error
Error: Type was not found or was not a compile-time constant: HttpStatusEvent
client.listener.onStatus = function(event:HttpStatusEvent):void {
...
. Any ideas?
btw / before compiling "compc -load-config=build-swc.xml" I hade to
change
<path-element>${flexlib}/libs/player/9/playerglobal.swc</path-element>
to
<path-element>${flexlib}/libs/player/10.0/playerglobal.swc</path-element>
in order for it to compile because my flex version doesn't have a playerglobal.swc for Flash 9. 8o
Unless this is a custom defined class, there is no such thing as HttpStatusEvent, you need to import flash.events.HTTPStatusEvent and refer to it as such.

flex builder new projects with syntax errors

I'm a junior developer and I'm having some problems with my Flex Builder 3. Every time I make a new project, Flex Builder detects syntax errors like:
1084: Syntax error: expecting rightbracket before leftbrace. FotoBeheer line 23
1084: Syntax error: expecting rightbracket before public. FotoBeheer line 22
1084: Syntax error: expecting rightparen before s. DomoticaSystem line 16
1093: Syntax error. DomoticaSystem line 16
Nevertheless, Fotobeheer will run, but any other program won't even start. Does anybody have any ideas how to solve this problem?
This is indicitive of syntax problems at or before the first line of error. Extra brackets or parenthesis are the typical culprit.

including Qt headers in DLL

I have a DLL in wich I would like to take a reference to a QObject and manipulate it, without actually creating an interface. So, I included "Qt/qobject.h" and compiled, but the compiler (Visual Studio 2008 pro) gives me syntax errors. It looks like it doesn't recognize the QThread object. How do I use a QObject in my dll? Is this even possible? Do I have to start my program from a Qt app? I'm actually trying to set a system-wide hook and get 3rd application QWidgets to manipulate... Any idea how I can use QObject in my dll?
Here are the errors:
1>------ Build started: Project: FroggerDLL, Configuration: Debug Win32 ------
1>Compiling...
1>FTClient.cpp
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(154) : error C2059: syntax error : 'type'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(154) : error C2238: unexpected token(s) preceding ';'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2144: syntax error : 'int' should be preceded by ')'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2059: syntax error : ')'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2208: 'int' : no members defined using this type
1>FroggerDLL - 6 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
Any help would be greatly appreciated,
Thanks
Dave
What's on line 154? Mine is just the declaration
QThread* thread() const;
but that's 4.5.1 on Linux so it might be different. The first reference to anything involving the token type is on line 204 which is a variable of type Qt::ConnectionType.
BTW. I just tried compiling the following on my system ( in the file incqobj.cpp )
include <QOObject>
QObject myQOject;
with
g++ -I/usr/lib/qt4/include -I/usr/lib/qt4/include/QtCore -c incqobj.cpp
and it compiled fine so it should be as simple as that.
Edit: Since Jesse confirms that it works for him on Windows I'm tempted to say that you've got a non-Qt macro coming in and interfering. One thing you could do is a sanity check on what the compiler is actually seeing by getting VS to only produce the preprocessed source rather than do the compilation.
I haven't used VS in years but I think the option is \E maybe?
[Edit: see the 2nd comment by Jesse, it should be /E] It may also be an explicit option now in the compiler properties which can be set for that source file. Can't remember where it puts the output either so you may need to hunt around for it a bit! If you get that going though you can check to see if the code looks right at the part that would correspond to line 154 in the original QObject header.
Thanks for all the help, solution: I had to include the Qt headers before all my other includes, and it now compiles.
Thanks again!
Try including QThread?
#include <QThread>
Qt uses forward declaration extensively and sometimes you need to include extra headers.
EDIT:
Do you set any defines? Here is what I have for my 2003 Qt commercial (4.3.4) project (executable that links to Qt dlls):
QT_LARGEFILE_SUPPORT
QT_DLL
QT_GUI_LIB
QT_CORE_LIB
QT_THREAD_SUPPORT
QT_NETWORK_LIB

Resources