flet-dev / flet-build-template

A Flutter bootstrap project Cookiecutter template for packaging Flet app
MIT License
17 stars 26 forks source link

flet build fail #2

Closed dhelbegor closed 9 months ago

dhelbegor commented 9 months ago

Hi, I'm trying to build a release for my mobile app using the template. The build for some reason fail. Can you help me please on understending what is happening?

the command that I'm running to build the app.

flutter build apk --release

The error that the outcome is giving me.

/home/dhelbegor/Android/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/dhelbegor/workspace/projects/dog_lover/build/serious_python_android/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libpythonbundle.so': The file was not recognized as a valid object file

/home/dhelbegor/Android/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/dhelbegor/workspace/projects/dog_lover/build/serious_python_android/intermediates/merged_native_libs/release/out/lib/x86_64/libpythonbundle.so': The file was not recognized as a valid object file

/home/dhelbegor/Android/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip: error: '/home/dhelbegor/workspace/projects/dog_lover/build/serious_python_android/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libpythonbundle.so': The file was not recognized as a valid object file

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.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     /home/dhelbegor/workspace/projects/dog_lover/build/app/intermediates/packaged_manifests/release/AndroidManifest.xml:2: error: attribute 'package' in <manifest> tag is not a valid Android package name: 'com.flet.'.
     /home/dhelbegor/workspace/projects/dog_lover/build/app/intermediates/packaged_manifests/release/AndroidManifest.xml:34: error: attribute 'android:name' in <activity> tag must be a valid Java class name.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 16s
Running Gradle task 'assembleRelease'...                           16.6s
Gradle task assembleRelease failed with exit code 1

What I did, downloaded the template zip my project add it to android/app/app.zip

and add the following to the pubspec.yaml

assets:
    - android/app/app.zip

That's all, I didn't changed nothing more.

thank you for your time :D

FeodorFitsner commented 9 months ago

You should not use flet-build-template directory as it is, literally, template with a bunch of missing information.

Use flet build command instead: https://flet.dev/docs/guides/python/packaging-app-for-distribution