Failed to start Flutter renderer: No GL implementation is available - linux

i create a simple "Hello Word" in flutter and enable web and linux platform to test is both,in chrome everything was ok and i see my first web app in flutter "Hello word",but in my desktop apps on Linux starting but not displaying anything and give me this message in terminal
libEGL warning: MESA-LOADER: failed to open swrast: /lib64/libpthread.so.0: version `GLIBC_PRIVATE' not found (required by /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri/../../../../lib/x86_64-linux-gnu/librt.so.1) (search paths /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri, suffix _dri)
** (app:22248): WARNING **: 05:45:50.289: Failed to start Flutter renderer: No GL implementation is available
Error waiting for a debug connection: The log reader stopped unexpectedly.
Error launching application on Linux.
and this is my hello word apps
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome to Flutter'),
),
body: const Center(
child: Text('Hello World'),
),
),
);
}
}
i use fedora 35 beta
i hope u can help me guys and thanks you

Judging from the error message, it seems like it is an error with glibc or glibc-devel not being installed. I am running Fedora 34, so I can't search F35's repos but if you run dnf repoquery --whatprovides 'libpthread.so*' it should give you the name of the packages required for it to run.
If the packages are already installed, please let me know and I will see if I can help you out by editing this answer.
EDIT: I don't have any experience with Snap but, after some digging, it looks like you can't expose certain folders in Snap, so a quick (albeit dirty) fix is to add the file flutter cannot find to the folder containing the Snap package.
You could also try this:
$ snap run --shell <snap>.<command>
$ env
XDG_VTNR=1
SSH_AGENT_PID=5543
XDG_SESSION_ID=2
SNAP_USER_COMMON=/home/<user>/snap/<snap>/common
SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:
SNAP_COMMON=/var/snap/<snap>/common
[...]
Edit the line from SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl: to SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/path/to/folder/containing/libpthread, save the edits and try to launch the app again.
You can find where libpthread is located by opening your file manager, browse to / (in GNOME this is under 'Other locations' > 'Computer' in the left-hand navigation pane), unhide hidden folders (Ctrl + H) and use the search function. This should show where the file is located (on my machine it's under /usr/lib64) and you add the folder to the SNAP_LIBRARY_PATH.

The issue is because of the snap install, what worked for me is replacing the snap version with the manual install from github. You can also use the tarball.
git clone https://github.com/flutter/flutter.git -b stable
now to add flutter to path:
sudo gedit ~/.bashrc
Assuming ur flutter install was at /home/user/ add this at the end of the file:
export PATH="$PATH:/flutter/bin"
If ur flutter install is somewhere else then change the directory accordingly
After saving and exiting, refresh ur .bashrc file with:
source ~/.bashrc
Now check if its added to path with:
echo $PATH
If you see a /flutter/bin then ur doing fine. To check if flutter's installed:
flutter --version
To add any missing dependencies (if ur on Fedora) use:
sudo dnf install bash curl file git unzip which xz zip mesa-libGLU clang cmake ninja-build pkg-config gtk3-devel
On Ubuntu based distros it is
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev

Related

Linphone Android native sdk not ready yet

I use git clone git://git.linphone.org/linphone-android.git --recursive
I follow instruction on https://github.com/BelledonneCommunications/linphone-android/ and download lastest SDK and NDK
I set path -> sudo gedit ~/.bashrc and add last line with :
export ANDROID_HOME=/home/onysevensmarts/Android/Sdk
export ANDROID_NDK=/home/onysevensmarts/Android/Sdk/ndk-bundle
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_NDK
export PATH=$PATH:$JAVA_HOME
4.I've just install Install yasm, nasm , python, pkg_config, doxygen, graphviz and cmake 3.14 .
5.At Root direktori , execute command ./prepare.py
showing message :
Configure project :liblinphone-sdk
native sdk not ready yet
6.Then I Download last liblinphone (liblinphone-android-sdk-4.0.1.zip) at https://www.linphone.org/technical-corner/liblinphone
7.I extract them, there are 3 files
- liblinphone-sdk-javadoc.jar,
- liblinphone-sdk-release.aar,
- liblinphone-sdk-sources.jar.
8. I copy them to liblinphone-sdk folder on root direktory project.
9. I try ./prepare.py againt and still show error : native sdk not ready yet.
Where i do wrong? , and i try to 'make' , this error still show,
i try open on Android Studio and i build , error message path=""
Anyone ever see this case, help .
Check cd ~/Android/Sdk/tools/bin./sdkmanager "platform-tools" "platforms;android-28" https://developer.android.com/studio/command-line/sdkmanager.html
if number 1 error, do : export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
if repositories.cfg not found ,then : touch ~/.android/repositories.cfg
sudo pip install pystache
if pip not found : sudo apt install python-pip
pip install pystache
run 'make'
try to 'make install' and make sure android device connected debugging with your PC.

How to change style in PyQt5

I am writing a Qt5 application by using PyQt.
I would like to understand how to change the style of the entire application.
The old Qt4 calls like:
app = QApplication(sys.argv)
app.setStyle(QStyleFactory.create('Cleanlooks'))
and the suggested method here does nothing.
Are they deprecated?
https://blog.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/
Thank you!
may be Cleanlooks is no longer available on your system. By QStyleFactory.keys() you can ask the available styles on your system. On Ubuntu 16.04 and pyqt5 i only get:
['Windows', 'GTK+', 'Fusion']
edit:
here you find the qstyleplugin
containing 6 additional styles, you have to compile it by yourself
edit:
on ubuntu 16.04, python3.5 i got it working by installing the styleplugins to QT5 and compile pyqt5 from source against this QT5:
install QT 5.7 by onlineinstaller
in installationdirectory search qmake, in my case /opt/Qt/5.7/gcc_64/bin/qmake
download qtstyleplugin to an arbitrary directory git clone https://code.qt.io/qt/qtstyleplugins.git and install it:
cd qtstyleplugins
/opt/Qt/5.7/gcc_64/bin/qmake # the qmake from the fresh installation
make
make install
now there is a folder „styles“ in /opt/Qt/5.7/gcc_64/plugins/ containing the additional styles.
download sip-source, compile and install it
download pyqt5-source, compile and install it, in the step python3 configure.py provide the qmake from the QT5-Installation by the --qmake-option and look in the output for missing dependencies.
Now the following styles are available:
['bb10dark', 'bb10bright', 'cleanlooks', 'cde', 'motif', 'plastique', 'Windows', 'Fusion']
i got an sip-error:
RuntimeError: the sip module implements API v11.0 to v11.2 but the PyQt5.QtCore module requires API v11.3
to prevent it, run sudo apt-get purge python3-sip before installing sip as described here

Trouble using QSerialport in Ubuntu

I made a full application in QT creator on my mac (tested and working) and now need to move the source code to my Ubuntu machine and recompile it in QT creator in ubuntu.
This problem is as soon as the project opens I get this error in the "general messages" log
Project ERROR: Unknown module(s) in QT: serialport
So I assumed that QSerialport isn't included in the ubuntu release of QT creator.
I tried to get it myself using these terminal commands I got from a tutorial for installing QSerialport (I don't know linux at all and this is my first time using it).
git clone git://code.qt.io/qt/qtserialport.git
cd qtserialport
git checkout qt5.x.y
This is where i get stuck. I have tried substituting 'x' and 'y' for every number and its returns that no such file can be found.
Have I made some simple mistake? Has anyone out there had to do this?
Try this for your self:
git clone git://code.qt.io/qt/qtserialport.git
mkdir qtserialport-build
cd qtserialport-build
qmake ../qtserialport/qtserialport.pro
sudo make install
Listed in the Ubuntu package repo is the libqt5serialport package, so it should be available but you may need to install the package manually: http://packages.ubuntu.com/trusty/libqt5serialport5
Found the solution:
If anyone else has this problem open "Maintain QT" (which can be found in the installation folder). Select "Add or remove components". In the version of QT you have installed there is a sub-heading called "Source components" and within the "Add ons" category you need to select Qserialport". Then just hit next and install.
Everything worked fine after this.

How do I compile QScintilla and Eric6 on Linux?

First I install QScintilla by following steps:
1:
cd Qt4Qt5
qmake qscintilla.pro
sudo make
make install
2:
cd ../designer-Qt4Qt5
qmake designer.pro
sudo make
sudo make install
3:
cd ../Python
python3 configure.py --pyqt=PyQt5
sudo make
And here I met the problem :
QAbstractScrollArea: No such file or directory
and problem:
qprinter.h: No such file or directory
But I finally solved them by manually add required files.
Goes on:
sudo make install
4:
then I go to install eric6 by typing:
sudo python3 install.py
But I got:
Checking dependencies
Python Version: 3.4.0
Found PyQt5
Sorry, please install QScintilla2 and
its PyQt5/PyQt4 wrapper.
Error: /usr/lib/python3/dist-packages/PyQt5/Qsci.so: undefined symbol: _ZTI13QsciScintilla
The main problem is that you are linking against Qt4 rather than Qt5. This is why the QAbstractScrollArea and QPrinter headers are reported as missing, and why you later get the undefined symbol error.
QScintilla uses a features file to control compile-time configuration, and its sources need to be patched to get a good build for Qt5.
So first unpack a fresh set of sources, and then make these changes:
designer-Qt4Qt5/designer.pro:
TARGET = qscintillaplugin_qt5
Qt4Qt5/features/qscintilla2.prf:
} else {
LIBS += -lqscintilla2_qt5
}
}
} else {
LIBS += -lqscintilla2_qt5
}
Qt4Qt5/qscintilla.pro:
TARGET = qscintilla2_qt5
...
features.path = $$[QT_INSTALL_ARCHDATA]/mkspecs/features
This will ensure that you get independent qscintilla libs for Qt5.
With that done, take the following steps to build (as a normal user):
cd 'path/to/src/Qt4Qt5'
# this is essential for correct linking
export QMAKEFEATURES="$PWD/features"
# make sure you use the right qmake!
qmake-qt5 'qscintilla.pro'
make
# plugin for Qt5 Designer
cd '../designer-Qt4Qt5'
qmake-qt5 'designer.pro' INCLUDEPATH+='../Qt4Qt5' QMAKE_LIBDIR+='../Qt4Qt5'
make
# Python bindings
cd '../Python'
python3 'configure.py' --pyqt='PyQt5' --qmake='/usr/bin/qmake-qt5' \
--qsci-incdir='../Qt4Qt5' --qsci-libdir='../Qt4Qt5'
make
If successful, you can then install everything (as root):
cd 'path/to/src/Qt4Qt5'
make install
cd '../designer-Qt4Qt5'
make install
cd '../Python'
make install
ekhumoro's solution above did not quite work for me - let's just say maybe I missed something, or it's an environment-specific thing.
Anyway.... I did what ekhumoro advised except didn't edit these three files: (XXX)
- designer-Qt4Qt5/designer.pro
- Qt4Qt5/features/qscintilla2.prf
- Qt4Qt5/qscintilla.pro
the reason for editing them seems sound, but at the end of the day Eric install failed with:
Sorry, please install QScintilla2 and its PyQt5/PyQt4 wrapper.
Error:
dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyQt5/Qsci.so, 2):
Library not loaded: libqscintilla2_qt5.12.dylib
^^^^
Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyQt5/Qsci.so
Reason: image not found
note the _qt5 marked with ^^^^ - theoretically that should resolve, but for me it did not. I tried all kinds of things to no avail. May be my ignorance of some setting.
I expected ekhumoro's instructions to work, since the edits suggested for the 3 files - see (XXX) - configure Make to create libraries with _qt5.
I tried many things - symlinks, etcetc., but at the end of the day, leaving out (XXX) allowed everything to proceed properly.
So - in summary, *if you don't need to have QScintilla work simultaneously with PyQt4 and PyQt5*, do ekhumoro's advice minus the stuff at (XXX) - that way, Eric should install without problems.
Take care with the information above: it will probably clobber QScintilla libs for Qt4
I guess the most important is --pyqt=PyQt5 which leads to using sip/qscimod5.sip instead of sip/qscimod4.sip. Difference is that it contains line %Import QtWidgets/QtWidgetsmod.sip which is essential for QAbstractScrollArea.

Install an ircbot that handles greetings of certain users

I want to greet a certain user ffki-besucher in a certain IRC channel.
Whenever that user logs in, it should get a special message written directly into the channel. I heard weechat is a good solution, but how can I achieve this?
How do I install weechat on debian wheezy?
I already installed some packages:
apt-get install weechat-curses weechat-plugins weechat-scripts perl
I use this cool guide at https://weechat.org/files/doc/stable/weechat_quickstart.en.html
Then I start weechat as user (not root):
weechat-curses
(in case you want to quit, use /quit)
Now I need the scripts, but I am stuck how to get this command running:
/script install buffers.pl
I also tried to load the script plugin again with
/plugin autoload script
The script plugin seems to be missing on debian! weechat in debian wheezy is quite old (0.3.8 which has a bug that the script plugin is not included in the debian package)
(I tried to install weechat from jessie, but that would give dependencie problems with some pelrl libs, that go down to the kernel)
Uninstall the repository packages with
apt-get remove weechat*
and install the new packages directly from the weechat download site which are version 1.0.1-1:
cd /tmp/
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-core_1.0.1-1_amd64.deb
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-curses_1.0.1-1_amd64.deb
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-plugins_1.0.1-1_amd64.deb
install guile:
aptget install guile-2.0-libs
then install the packages:
dpkg -i weechat-*
Now you can start weechat as user (not as root) and install the scripts:
/script install buffers.pl
/script install jnotify.pl
Connect to your server:
/server add oftc irc.oftc.net/6667
further set your connection like described here: https://weechat.org/files/doc/stable/weechat_quickstart.en.html#irc_server_options
some tips:
autocomplete with TAB or Shift-TAB
change buffer with Alt+1 or Alt+2,...
install beep.pl to send a notification through screen to your desktop (needs some configuration)
use /help jnotify to achieve the auto notifications to certain users, etc
Install irssi instead:
apt-get install irssi
su into your user and add the trigger.pl script. create:
mkdir -p ~/.irssi/scripts
cd ~/.irssi/scripts
git clone https://github.com/coekie/irssi-scripts/ coeki-irssi-scripts
ln -s coeki-irssi-scripts/trigger.pl
mkdir autorun
cd autorun
ln -s ../trigger.pl
Now start irssi as user
/connect irc.hackint.org
/join #ffki
/nick bot-rubo77
You can later edit your ~/.irssi/config file to autojoin your server and channel with a certain nick:
{ address = "irc.hackint.net"; chatnet = "hackint"; port = "6697"; use_ssl="yes"; autoconnect="yes"; },
...
chatnets = {
hackint = {
type = "IRC";
nick="bot-rubo77";
};
};
change to the status window (ESC 1) and create the trigger:
/trigger add -joins -channels "#ffki" -masks "*ffki-b*#*" -command "msg #ffki Hi $N! Please be patient! Not everyone is at the keyboard but you will be noticed in a few minutes ..."
/trigger save
some tips:
ESC 1 - switch to status window
ESC 2 - switch to window 2 (usually your first chat window) ...
/names shows all users in the channel
you can change the trigger in ~/.irssi/triggers and then type /trigger reload in the status window

Resources