flet-dev / serious-python

Python runtime for Flutter apps
Apache License 2.0
212 stars 22 forks source link

libpythonbundle.so': The file was not recognized as a valid object file #24

Closed bobwatcherx closed 1 year ago

bobwatcherx commented 1 year ago

i try build apk my flet in flutter but error for build apk . i test my empty flutter hello world project and this work but not work for serious_python

my code https://github.com/bobwatcherx/fluttermyapp

i get erro when build apk

root@miop-HP-Convertible-x360-11-ab1XX:/home/miop/belajar/flutterapk/myapp# flutter build apk
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎

Warning: Observed package id 'tools' in inconsistent location '/root/Android/Sdk/cmdline-tools/tools' (Expected '/root/Android/Sdk/tools')
Warning: Observed package id 'tools' in inconsistent location '/root/Android/Sdk/cmdline-tools/tools' (Expected '/root/Android/Sdk/tools')
Checking the license for package NDK (Side by side) 23.1.7779620 in /root/Android/Sdk/licenses
License for package NDK (Side by side) 23.1.7779620 accepted.
Preparing "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)".
"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" ready.
Installing NDK (Side by side) 23.1.7779620 in /root/Android/Sdk/ndk/23.1.7779620
"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" complete.
"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" finished.
Warning: Observed package id 'tools' in inconsistent location '/root/Android/Sdk/cmdline-tools/tools' (Expected '/root/Android/Sdk/tools')
Warning: Observed package id 'tools' in inconsistent location '/root/Android/Sdk/cmdline-tools/tools' (Expected '/root/Android/Sdk/tools')
Checking the license for package CMake 3.18.1 in /root/Android/Sdk/licenses
License for package CMake 3.18.1 accepted.
Preparing "Install CMake 3.18.1 (revision: 3.18.1)".
"Install CMake 3.18.1 (revision: 3.18.1)" ready.
Installing CMake 3.18.1 in /root/Android/Sdk/cmake/3.18.1
"Install CMake 3.18.1 (revision: 3.18.1)" complete.
"Install CMake 3.18.1 (revision: 3.18.1)" finished.
Warning: Observed package id 'tools' in inconsistent location '/root/Android/Sdk/cmdline-tools/tools' (Expected '/root/Android/Sdk/tools')
Checking the license for package Android SDK Platform 31 in /root/Android/Sdk/licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision: 1)".
"Install Android SDK Platform 31 (revision: 1)" ready.
Installing Android SDK Platform 31 in /root/Android/Sdk/platforms/android-31
"Install Android SDK Platform 31 (revision: 1)" complete.
"Install Android SDK Platform 31 (revision: 1)" finished.
/root/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/miop/belajar/flutterapk/myapp/build/serious_python/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libpythonbundle.so': The file was not recognized as a valid object file

/root/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/miop/belajar/flutterapk/myapp/build/serious_python/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libpythonbundle.so': The file was not recognized as a valid object file

/root/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/miop/belajar/flutterapk/myapp/build/serious_python/intermediates/merged_native_libs/release/out/lib/x86_64/libpythonbundle.so': The file was not recognized as a valid object file
bobwatcherx commented 1 year ago
root@miop-HP-Convertible-x360-11-ab1XX:/home/miop/belajar/flutterapk/myapp# flutter doctor
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel master, 3.14.0-12.0.pre.81, on Linux Mint 21 5.15.0-41-generic, locale en_US.UTF-8)
    ! Warning: `dart` on your path resolves to /usr/lib/dart/bin/dart, which is not inside your current Flutter SDK
      checkout at /home/miop/flutter/flutter. Consider adding /home/miop/flutter/flutter/bin to the front of your path.
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.3)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.
FeodorFitsner commented 1 year ago

Update Flet dependency to 0.10.1, rebuild app.zip and try again.

bobwatcherx commented 1 year ago

i still get new error like this

root@miop-HP-Convertible-x360-11-ab1XX:/home/miop/belajar/flutterapk/myapp# flutter build apk
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎

   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1261080 bytes (23.3% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
e: /root/.gradle/caches/transforms-3/c4988ff80110f75080a936fc6f044848/transformed/core-1.10.1/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /root/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-jvm/1.6.0/a7257339a052df0f91433cf9651231bbb802b502/annotation-jvm-1.6.0.jar!/META-INF/annotation.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /root/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22/1a8e3601703ae14bb58757ea6b2d8e8e5935a586/kotlin-stdlib-common-1.8.22.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.

you can check my repo update above

bobwatcherx commented 1 year ago

i same error after upgrade flet 0.10.1

/root/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/miop/belajar/flutterapk/myapp/build/serious_python/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libpythonbundle.so': The file was not recognized as a valid object file

/root/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/miop/belajar/flutterapk/myapp/build/serious_python/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libpythonbundle.so': The file was not recognized as a valid object file

/root/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/miop/belajar/flutterapk/myapp/build/serious_python/intermediates/merged_native_libs/release/out/lib/x86_64/libpythonbundle.so': The file was not recognized as a valid object file

my code in repo

FeodorFitsner commented 1 year ago

That error does not break the build and shown as a warning.