mumumusuc / termux-flutter

Run Flutter on Termux !
GNU General Public License v3.0
73 stars 10 forks source link

flutter run got error #6

Closed jongbatax closed 1 year ago

jongbatax commented 1 year ago

Launching lib/main.dart on Linux in debug mode...Building Linux application... CMake Error at /data/data/com.termux/files/usr/share/cmake-3.27/Modules/FindPkgConfig.cmake:607 (message): Building Linux application... A required package was not found Building Linux application... Call Stack (most recent call first): Building Linux application... /data/data/com.termux/files/usr/share/cmake-3.27/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal) Building Linux application... flutter/CMakeLists.txt:25 (pkg_check_modules)

any suggess?

mumumusuc commented 1 year ago

(message): Building Linux application... A required package was not found

run flutter doctor -v and install the missing packages.

flutter doctor -v 
...
[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.6
    • cmake version 3.27.6
    • ninja version 1.11.1
    • pkg-config version 0.29.2
...

or just install all these

apt install gtk3 fontconfig ninja cmake clang pkg-config
jongbatax commented 1 year ago

i'm using termux gui (not proot), still got the error... capture-2023-10-24-16-47-13

when i created new project i get warning capture-2023-10-24-16-50-14

mumumusuc commented 1 year ago

i'm using termux gui (not proot), still got the error... capture-2023-10-24-16-47-13

apt install gtk3 doesn't work?

when i created new project i get warning capture-2023-10-24-16-50-14

it does't matter [flutter doctor] Could not determine java version with JDK 21

openjdk17 is provided by Termux but flutter cannot parse it's version.

java --version

openjdk 17-internal 2021-09-14
OpenJDK Runtime Environment (build 17-internal+0-adhoc..src)
OpenJDK 64-Bit Server VM (build 17-internal+0-adhoc..src, mixed mode)

flutter accepts version string like openjdk 17.xx instead of openjdk 17-internal

jongbatax commented 1 year ago

i'm using termux gui (not proot), still got the error... capture-2023-10-24-16-47-13

apt install gtk3 doesn't work?

when i created new project i get warning capture-2023-10-24-16-50-14

~it does't matter~ [flutter doctor] Could not determine java version with JDK 21

openjdk17 is provided by Termux but flutter cannot parse it's version.

java --version

openjdk 17-internal 2021-09-14
OpenJDK Runtime Environment (build 17-internal+0-adhoc..src)
OpenJDK 64-Bit Server VM (build 17-internal+0-adhoc..src, mixed mode)

flutter accepts version string like openjdk 17.xx instead of openjdk 17-internal

gtk3 is already the newest version

mumumusuc commented 1 year ago

does pkg-config --libs gtk+-3.0 works?

please run flutter run -d linux -v at hello_world for more debug message.

jongbatax commented 1 year ago

capture-2023-10-24-21-34-27

then i installing xorgproto to solve the problem

then i try to compile again then get this error message capture-2023-10-24-21-46-05

capture-2023-10-24-21-39-22

mumumusuc commented 1 year ago

capture-2023-10-24-21-34-27

then i installing xorgproto to solve the problem

then i try to compile again then get this error message capture-2023-10-24-21-46-05

capture-2023-10-24-21-39-22

run and paste the full output

flutter clean
flutter run -d linux -v
jongbatax commented 1 year ago

problem found: I use flutter 3.16, so i down grade to flutter 3.15 pre 12 (like engine version)

run : flutter run -d linux -v

got this error: (libepoxy.so not found)

[ +24 ms] CANNOT LINK EXECUTABLE "/data/data/com.termux/files/home/hello_world/bui ld/linux/arm64/debug/bundle/hello_world": library "libepoxy.so" not found: needed by /data/data/com.termux/files/home/hello_world/buil d/linux/arm64/debug/bundle/lib/libflutter_linux_g tk.so in namespace (default) [ +8 ms] Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. [ +3 ms] Error launching application on Linux. [ +5 ms] "flutter run" took 28,858ms. [ +4 ms]

0 throwToolExit

(package:flutter_tools/src/base/common.dart:10:3)

1 RunCommand.runCommand

(package:flutter_tools/src/commands/run.dart:752: 9)

#2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command .dart:1350:27)
mumumusuc commented 1 year ago

problem found: I use flutter 3.16, so i down grade to flutter 3.15 pre 12 (like engine version)

run : flutter run -d linux -v

got this error: (libepoxy.so not found)

[ +24 ms] CANNOT LINK EXECUTABLE "/data/data/com.termux/files/home/hello_world/bui ld/linux/arm64/debug/bundle/hello_world": library "libepoxy.so" not found: needed by /data/data/com.termux/files/home/hello_world/buil d/linux/arm64/debug/bundle/lib/libflutter_linux_g tk.so in namespace (default) [ +8 ms] Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. [ +3 ms] Error launching application on Linux. [ +5 ms] "flutter run" took 28,858ms. [ +4 ms] #0 throwToolExit

(package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand

(package:flutter_tools/src/commands/run.dart:752: 9) #2 FlutterCommand.run.

(package:flutter_tools/src/runner/flutter_command .dart:1350:27)

LD_LIBRARY_PATH=$PREFIX/lib flutter run -d linux -v
jongbatax commented 1 year ago

SOLVED!!!

Thank you very much. capture-2023-10-24-22-59-25

fotiDim commented 10 months ago

@mumumusuc I am facing the same issue:

"libepoxy.so" not found: needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so

I am on Flutter 3.16.5. Do I need to downgrade it and if yes how? 3.15 which is mentioned by @jongbatax is not in the stable channel.

mumumusuc commented 10 months ago

@mumumusuc I am facing the same issue:

"libepoxy.so" not found: needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so

I am on Flutter 3.16.5. Do I need to downgrade it and if yes how? 3.15 which is mentioned by @jongbatax is not in the stable channel.

@fotiDim libepoxy should be automatically installed while installing gtk3, install it manually by apt install libepoxy.

please refer to the install section about dependencies.

fotiDim commented 10 months ago

@mumumusuc I made a fresh install and now I am getting:

/usr/bin/ld: warning: libdl.so, needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: liblog.so, needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libc.so, needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)

I am using Debian under PRoot. Some packages are not available:

user@localhost:~/hello_world$ sudo apt install x11-repo which gtk3 fontconfig xorgproto ninja cmake clang pkg-config
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'gnu-which' instead of 'which'
E: Unable to locate package x11-repo
E: Unable to locate package gtk3
E: Unable to locate package xorgproto
E: Unable to locate package ninja
mumumusuc commented 10 months ago

@mumumusuc I made a fresh install and now I am getting:

/usr/bin/ld: warning: libdl.so, needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: liblog.so, needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libc.so, needed by /home/user/hello_world/linux/flutter/ephemeral/libflutter_linux_gtk.so, not found (try using -rpath or -rpath-link)

I am using Debian under PRoot. Some packages are not available:

user@localhost:~/hello_world$ sudo apt install x11-repo which gtk3 fontconfig xorgproto ninja cmake clang pkg-config
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'gnu-which' instead of 'which'
E: Unable to locate package x11-repo
E: Unable to locate package gtk3
E: Unable to locate package xorgproto
E: Unable to locate package ninja

@fotiDim This project is not for proot-distro, just launch it on Termux. Additional, proot-distro can use official flutter instead of this repo.