PySide6 registering to QScxmlStateMachine event failure - pyside6

PySide on Python 3.10.5
PySide6.__version_info__ = (6, 3, 0, '', '')
Using QScxmlStateMachine connectToEvent(), method I always get the message:
qt.core.qobject.connect: QObject::connect: No such slot ...
The error happens when the slot has an argument of type QScxmlEvent. No error when no argument in the slot but such slot is not useful. The C++ code can use many overriden connectToEvent signatures, PySide only has one of them and it resembles the old signal-slot way, using the SLOT macro.
The code is:
from PySide6.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QLabel
from PySide6.QtCore import SLOT, Slot, Qt
from PySide6.QtScxml import QScxmlStateMachine, QScxmlEvent
class MainWindow(QWidget):
def __init__(self, scxml_file_name: str) -> None:
super().__init__()
self.machine = QScxmlStateMachine.fromFile(scxml_file_name)
if self.machine.parseErrors():
raise Exception()
self.machine.start()
layout = QVBoxLayout(self)
self.label = QLabel(self)
self.label.setAlignment(Qt.AlignCenter)
layout.addWidget(self.label, 0)
to_local = QPushButton('To Local', self)
to_local.clicked.connect(lambda: self.machine.submitEvent('to_local'))
layout.addWidget(to_local, 0)
to_global = QPushButton('To Global', self)
to_global.clicked.connect(lambda: self.machine.submitEvent('to_global'))
layout.addWidget(to_global, 0)
to_quit = QPushButton('To Out', self)
to_quit.clicked.connect(lambda: self.machine.submitEvent('to_out'))
layout.addWidget(to_quit, 0)
exit = QPushButton('Quit', self)
exit.clicked.connect(self.close)
layout.addWidget(exit, 0)
self.setLayout(layout)
self.machine.connectToEvent('exiting', self, SLOT('on_exiting(QScxmlEvent)'))
self.machine.reachedStableState.connect(lambda: self.label.setText(
', '.join(self.machine.activeStateNames()))
)
#Slot(QScxmlEvent)
def on_exiting(self, event: QScxmlEvent):
print(event)
if __name__ == '__main__':
app = QApplication()
win = MainWindow('statechart.scxml')
win.show()
app.exec()
The statechart is:
<?xml version="1.0" ?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="Statechart" initial="global">
<state id="global">
<transition event="to_local" target="local"/>
</state>
<state id="local">
<transition event="to_global" target="global"/>
<transition event="to_out" target="quit">
<send event="exiting">
<param name="state" expr="local"/>
</send>
</transition>
</state>
<final id="quit" />
</scxml>
I just can't figure out why the connection fails.

Related

Problem using Firebase Facebook and Google login on Android

I can't use the firebase login with facebook or google in my Flutter application. It works fine on ios
It doesn't receive confirmation from the provider and doesn't throw success or error. It doesn't work on simulator or real device. The login by email works perfect
My login code:
final _auth = FirebaseAuth.instance;
_auth.onAuthStateChanged.listen((user) {
if (user != null) {
//get useer data
} else {
//go to login page
}
});
Future<Null> _loginByFacebook(Completer completer) async {
FacebookLogin facebookLogin = new FacebookLogin();
FacebookLoginResult result = await facebookLogin.logInWithReadPermissions(['email', 'public_profile']);
switch (result.status) {
case FacebookLoginStatus.loggedIn:
AuthCredential credential = FacebookAuthProvider.getCredential(accessToken: result.accessToken.token);
FirebaseAuth.instance.signInWithCredential(credential);
completer.complete();
break;
case FacebookLoginStatus.cancelledByUser:
break;
case FacebookLoginStatus.error:
completer.completeError(result.errorMessage);
}
}
Future<Null> _loginByGoogle( Completer completer) async {
try {
await GoogleSignIn().signIn();
completer.complete();
} catch (error) {
completer.completeError(error);
print(error);
}
}
My AndroidManifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="app"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!--facebook login configuration>-->
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!--end facebook configuration-->
</application>
</manifest>
Debug informatino when I try to usee the facebook login:
D/ (19022): HostConnection::get() New Host Connection established 0x8fe3ca80, tid 19059
D/EGL_emulation(19022): eglMakeCurrent: 0x9cba4460: ver 2 0 (tinfo 0xa1283790)
I/flutter (19022): user not logged :`(
W/System (19022): ClassLoader referenced unknown path: /system/app/Chrome/lib/x86
I/WebViewFactory(19022): Loading com.android.chrome version 51.0.2704.90 (code 275509012)
I/cr_LibraryLoader(19022): Time to load native libraries: 1 ms (timestamps 9943-9944)
I/cr_LibraryLoader(19022): Expected native library version number "51.0.2704.90", actual native library version number "51.0.2704.90"
V/WebViewChromiumFactoryProvider(19022): Binding Chromium to main looper Looper (main, tid 1) {2441051}
I/cr_LibraryLoader(19022): Expected native library version number "51.0.2704.90", actual native library version number "51.0.2704.90"
I/chromium(19022): [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup(19022): Initializing chromium process, singleProcess=true
E/ApkAssets(19022): Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
E/ApkAssets(19022): Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin
D/EGL_emulation(19022): eglCreateContext: 0x86b79440: maj 2 min 0 rcv 2
D/EGL_emulation(19022): eglMakeCurrent: 0x86b79440: ver 2 0 (tinfo 0x8b5c1ef0)
W/cr_media(19022): Requires BLUETOOTH permission
D/cr_Ime (19022): [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents(19022): onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime (19022): [InputMethodManagerWrapper.java:59] isActive: false
I/cr_Ime (19022): ImeThread is not enabled.
E/libEGL (19022): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/VideoCapabilities(19022): Unsupported profile 4 for video/mp4v-es
D/ (19022): HostConnection::get() New Host Connection established 0x821595c0, tid 19100
D/EGL_emulation(19022): eglCreateContext: 0x82103120: maj 2 min 0 rcv 2
D/EGL_emulation(19022): eglMakeCurrent: 0x82103120: ver 2 0 (tinfo 0x827c98b0)
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
W/cr_BindingManager(19022): Cannot call determinedVisibility() - never saw a connection for the pid: 19022
D/cr_Ime (19022): [InputMethodManagerWrapper.java:59] isActive: false
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
W/art (19022): Attempt to remove non-JNI local reference, dumping thread
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
When I try the google login only appears: D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
Any guess where may be the problem? :)
UPDATE: I could make it work with Google Sign in updating the code to:
Future<Null> _loginByGoogle( Completer completer) async {
try {
final GoogleSignIn _googleSignIn = GoogleSignIn();
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
await _auth.signInWithCredential(credential);
completer.complete();
} catch (error) {
completer.completeError(error.message);
print(error);
}
}
But, the Facebook login problem keeps the same. When it requests the login it doesn't get result (success or failure)

Firebase push notification with custom sound (Flutter)

I'm currently using firebase messaging cloud to push notification for my app. I'm trying to make a custom notification sound for the push notification. I believe that it can be done by putting "sound: blabla.mp3" inside the payload, but how do i define the sound inside dart page?
Use flutter_local_notifications package
AndroidNotificationDetails androidNotificationsDetails = AndroidNotificationDetails(
'your other channel id',
'your other channel name',
'your other channel description',
importance: Importance.Max,
priority: Priority.Max,
enableLights: true,
playSound: true,
sound: RawResourceAndroidNotificationSound('notification'),
);
Note: you should add notification.mp3 file in android/app/src/main/res/raw/notification.mp3 and don't forget to specify playSound:
playSound: true,
this worked for me in the foreground / background and when the app is closed.
It can be done flutter_local_notifications plugin.
First, you should define channels for both Android and iOS:
const androidPlatformChannel = AndroidNotificationDetails(
'ANDROID_CHANNEL_ID',
'Name',
'Description',
color: Color.fromARGB(255, 0, 0, 0),
importance: Importance.max,
sound: RawResourceAndroidNotificationSound('notification_sound'),
playSound: true,
priority: Priority.high,
showWhen: false,
);
const iOSPlatformChannel = IOSNotificationDetails(
sound: 'notification_sound.aiff',
presentAlert: true,
presentBadge: true,
presentSound: true,
);
const platformChannel = NotificationDetails(
android: androidPlatformChannel,
iOS: iOSPlatformChannel,
);
Then show a notification:
await flutterLocalNotificationsPlugin.show(
id,
title,
body,
platformChannel,
payload: notification.payload,
);
IMPORTANT! notification_sound.aiff file should be copied with XCode
you can do this simply by calling the sound and playing it in the firebase configure method.
widget._firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print('on message $message');
AudioCache player = new AudioCache();
const alarmAudioPath = "sounds/notification.mp3";
player.play(alarmAudioPath);
},
onResume: (Map<String, dynamic> message) async {
print('on resume $message');
},
onLaunch: (Map<String, dynamic> message) async {
print('on launch $message');
},
);
this wouldnt be effective as the file wouldnt be played if the app is in the background
To create a custom notification sound for both Android you will need to predefine a Notification Channel for your app. I used Flutter Local Notifications plugin to do this. In there, you can specify the parameters for your Android Notification Channel such as
var androidPlatformChannelSpecifics = AndroidNotificationDetails(
'your other channel id',
'your other channel name',
'your other channel description',
sound: RawResourceAndroidNotificationSound('slow_spring_board');
Note: slow_spring_board.mp3 is stored in the android\app\src\main\res\raw section of your app. Do not include the file extension when calling RawResourceAndroidNotificationSound()
There are other steps required to get it setup for iOS devices (mp3 are not supported). Once this is all done, you can begin working on your cloud messaging portion, in there you'll have to reference the notification channel id, and the sound file. I recommend including the audio file extension in that code.
You must create notification channel first with following code
Application.kt
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
import io.flutter.plugins.pathprovider.PathProviderPlugin;
import io.flutter.plugin.common.MethodChannel
import android.content.ContextWrapper
import android.content.Intent
import android.content.IntentFilter
import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import android.net.Uri;
import android.media.AudioAttributes;
import android.content.ContentResolver;
class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
this.createChannel()
FlutterFirebaseMessagingService.setPluginRegistrant(this)
}
override fun registerWith(registry: PluginRegistry?) {
// createChannel();
FirebaseCloudMessagingPluginRegistrant.registerWith(registry);
}
private fun createChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Create the NotificationChannel
val name: String = getString(R.string.default_notification_channel_id)
val channel = NotificationChannel(name, "default", NotificationManager.IMPORTANCE_HIGH)
val soundUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ getApplicationContext().getPackageName() + "/raw/sample");
val att = AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
.build();
channel.setSound(soundUri, att)
val notificationManager: NotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
/*
val id = mapData["id"]
val name = mapData["name"]
val descriptionText = mapData["description"]
val sound = "sample"
val importance = NotificationManager.IMPORTANCE_HIGH
val mChannel = NotificationChannel(id, name, importance)
mChannel.description = descriptionText
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(mChannel)
completed = true
*/
}
}
}
And android manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foodlz.orders">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name=".Application"
android:label="test App"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="#string/default_notification_channel_id"/>
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="#drawable/ic_appstore" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#color/colorPrimary" />
</application>
</manifest>
finally you must put your notification sound.wav file in res/raw
that's it

Android - write to a file . Can't find the file

I'm new to android, so this might be prety basic.
I'm trying to write data into a file, yet I can not find the file in the device.
I'm trying to get the file in the following directory:
"Computer\Nexus 5\Internal storage\Android\data\application name"
I have tried different method but none of them has worked:
FileOutputStream stream;
try {
stream = openFileOutput(filename,Context.MODE_APPEND | Context.MODE_WORLD_READABLE);
stream.write(string.getBytes());
stream.close();
}catch(IOException e){
}}
and
String path = Environment.getExternalStorageDirectory().getAbsolutePath()+"/Android/data/" + packageName + "/files/";
try {
boolean exists = (new File(path )).exists();
if (!exists) {
new File(path ).mkdirs();
}
// Open output stream
FileOutputStream fOut = new FileOutputStream(path + filename,true);
// write integers as separated ascii's
fOut.write((Integer.valueOf(content).toString() + " ").getBytes());
// Close output stream
fOut.flush();
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
I have added the permission in the manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.proLeague"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/>
<group gid="sdcard_rw" />
<group gid="media_rw" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:debuggable= "true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I thought maybe the file is logged properly but I need to pull it out from the ADB, is that possible?
I had manage to solve my issues on my own :
Evantually the code was fine, the problem was that on my nexus 5 phone I need to reboot the phone before I search for new files in the flash storage.
I saw in some blogs it is pretty common.

Microsoft XmlLite fails to detect end-of-element

I'm using Microsoft's XmlLite DLL to parse a simple XML file, using the code in the example XmlLiteReader. The essential part of the code (C++) is
while(S_OK == (hr = pReader->Read(&nodeType)))
{
switch(nodeType)
{
case XmlNodeType_Element:
// Get name...
WriteAttributes(pReader, es, attributes);
break;
case XmlNodeType_EndElement:
// Process end-of-element...
break;
}
and
HRESULT WriteAttributes(IXmlReader* pReader, CString& es, StringStringMap& attributes)
{
while(TRUE)
{
// Get and store an attribute...
HRESULT hrMove = pReader->MoveToNextAttribute();
}
// ...
}
So, here's my question. With XML input such as
<?xml version="1.0" encoding="utf-8"?>
<settings version="1.2">
<runID name="test" mode="N" take_data="Y">
<cell id="01">
<channel id="A" sample="something"/>
<channel id="B" sample="something else"/>
</cell>
<cell id="03">
<channel id="A" sample="other something"/>
<channel id="B" sample="other something else"/>
</cell>
</runID>
</settings>
Everything works as expected, except that the /> at the end of each channel line, which indicates the end of the element channel, isn't recognized as the end of an element. The successive node types following channel are whitespace (\n), then element (the second channel).
How can I determine from XmlLite that element `channel' has ended? Or am I misunderstanding the XML syntax?
You can test if an element ends with /> by using the function IsElementEmpty.

Unknown property error within item renderer's data property

I'm using an item renderer, but keep getting this actionscript error:
Error: Unknown Property: 'skillName'. at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:870]
at mx.binding::PropertyWatcher/updateProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:338]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.binding::Watcher/wrapUpdate()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Watcher.as:192]
at mx.binding::PropertyWatcher/updateParent()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:239]
at mx.binding::Watcher/updateChildren()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Watcher.as:138]
at mx.binding::PropertyWatcher/updateProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:347]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.binding::Watcher/wrapUpdate()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Watcher.as:192]
at mx.binding::PropertyWatcher/eventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:375]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at spark.components::DataRenderer/set data()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataRenderer.as:123]
at spark.components::SkinnableDataContainer/updateRenderer()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableDataContainer.as:606]
at spark.components.supportClasses::ListBase/updateRenderer()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\ListBase.as:1106]
at spark.components::DataGroup/setUpItemRenderer()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:1157]
at spark.components::DataGroup/initializeTypicalItem()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:327]
at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:384]
at spark.components::DataGroup/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:1467]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8430]
at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:665]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:816]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
The weird thing is that it worked fine, until at a certain point I kept getting this error, out of the blue. I've been searching for it on Google and Stackoverflow and struck upon a few websites, but none of the answers could help me get any further. It seems this error is also mostly thrown in mobile AIR projects, but mine is a Flash Player project...
This is how the itemrenderer looks:
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:components="components.*"
width="100%" height="100%" autoDrawBackground="true"
creationComplete="creationCompleteHandler(event)"
height.login_edit_state="80"
color.login_edit_state="#000000"
height.login_preview_state="80">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.utils.ArrayUtil;
public var loggedin:Boolean = true;
[Bindable]private var ac_projects:ArrayCollection;
protected function creationCompleteHandler(event:FlexEvent):void
{
currentState = "login_preview_state";
img_foldout_preview.addEventListener(MouseEvent.CLICK, changeState);
img_edit_preview.addEventListener(MouseEvent.CLICK, changeState);
http_projects.addEventListener(ResultEvent.RESULT, http_projects_resultEvent);
http_projects.addEventListener(FaultEvent.FAULT, http_projects_faultEvent);
http_projects.url = "http://localhost/sourcefoliocom.adobe.flexbuilder.project.flexbuilder/bindebug/php/getAllProjectsByUserSkill.php?id=" + data.userId + "&skill=" + data.skillId ;
trace("http://localhost/sourcefoliocom.adobe.flexbuilder.project.flexbuilder/bindebug/php/getAllProjectsByUserSkill.php?id="+ data.userId + "&skill=" + data.skillId);
http_projects.send();
}
protected function http_projects_resultEvent(event:ResultEvent):void
{
ac_projects = new ArrayCollection(ArrayUtil.toArray(event.result.projects.project));
rpt_projects.dataProvider = ac_projects;
}
protected function http_projects_faultEvent(event:FaultEvent):void
{
trace("Kon projecten niet laden");
}
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService id="http_projects"
method="GET" />
</fx:Declarations>
<s:states>
<s:State name="login_preview_state"/>
<s:State name="login_opened_state"/>
<s:State name="login_edit_state"/>
</s:states>
<s:layout.login_opened_state>
<s:VerticalLayout horizontalAlign="right"/>
</s:layout.login_opened_state>
<!-- login_opened_state -->
<s:SkinnableContainer includeIn="login_opened_state" width="100%" height="80">
<s:layout>
<s:HorizontalLayout gap="20" paddingBottom="20" paddingLeft="20" paddingRight="20" paddingTop="20" verticalAlign="middle"/>
</s:layout>
<s:Label fontSize="20" fontWeight="bold" text="{data.skillName}"/>
<s:Label fontSize="20" text="junior"/>
<s:Spacer width="100%" height="10"/>
<s:Image id="img_edit_open" width="20" height="20" source="images/edit.png" buttonMode="true" useHandCursor="true"/>
<s:Image id="img_foldin_open" width="20" height="20" buttonMode="true" source="images/foldin.png" useHandCursor="true"/>
</s:SkinnableContainer>
<s:VGroup id="vg_opened"
visible="false"
width="900" height="1000" gap="0"
horizontalAlign="right">
<mx:VBox>
<mx:Repeater id="rpt_projects" width="100%">
<components:Project currentItem= {rpt_projects.currentItem}" loggedin="true"/>
</mx:Repeater>
<components:AddProject />
</mx:VBox>
<s:Image x="824" width="76" height="51" source="images/edit_flag.png" useHandCursor="true"/>
</s:VGroup>
</s:ItemRenderer>
The error is thrown at this line:
<s:Label fontSize="20" fontWeight="bold" text="{data.skillName}"/>
The ArrayCollection filling up this renderer is an xml file my own webservice returns. I've tested the file and the use of skillName should be correct in this case.
Do you need to see more code or some more info? Let me know!
I found out I'm dealing with a two dimensional ArrayCollection. I'm not correctly referring to the items in this ArrayCollection, so that's why the properties are not recognized.

Resources