@@ -29,8 +29,16 @@ trap cleanup EXIT
2929echo " Copying model files to Android asset packs..."
3030mkdir -p " $ANDROID_ASSETS_DIR "
3131if [ -d " $ASSETS_DIR " ]; then
32+ echo " Source assets directory contents:"
33+ ls -lh " $ASSETS_DIR "
34+ find " $ASSETS_DIR " -type f -exec ls -lh {} \; | head -20
35+
3236 cp -r " $ASSETS_DIR " /* " $ANDROID_ASSETS_DIR " / 2> /dev/null || true
3337 echo " Files copied to Android asset packs"
38+
39+ echo " Android asset packs contents:"
40+ ls -lh " $ANDROID_ASSETS_DIR "
41+ find " $ANDROID_ASSETS_DIR " -type f -exec ls -lh {} \; | head -20
3442fi
3543
3644echo " Replacing model files with minimal placeholder files..."
@@ -44,16 +52,27 @@ find "$ASSETS_DIR" -name "*.json" ! -name "tokenizer.json" -exec sh -c 'echo "{}
4452# Replace .pte files with minimal content (just a null byte)
4553find " $ASSETS_DIR " -name " *.pte" -exec sh -c ' printf "\0" > "$1"' _ {} \;
4654
55+ echo " Placeholder files created:"
56+ find " $ASSETS_DIR " -type f -exec ls -lh {} \;
57+
4758echo " Building Release AAB..."
4859echo " NODE_ENV is set to: $NODE_ENV "
4960cd android
50- echo " Running gradle bundleRelease..."
51- ./gradlew bundleRelease
61+ ls -l
62+ cd ..
63+ cd assets/models/all-mini-lm
64+ ls -l
65+ echo " Running gradle bundleRelease with stacktrace..."
66+ # ./gradlew bundleRelease --stacktrace --info 2>&1 | tee ../gradle-build.log
5267cd ..
5368
5469if [ -f " $AAB_OUTPUT " ]; then
5570 echo " AAB built successfully: $AAB_OUTPUT "
5671 ls -lh " $AAB_OUTPUT "
72+
73+ # Check bundle size
74+ AAB_SIZE=$( stat -f%z " $AAB_OUTPUT " 2> /dev/null || stat -c%s " $AAB_OUTPUT " 2> /dev/null)
75+ echo " Bundle size: $( echo " scale=2; $AAB_SIZE / 1024 / 1024" | bc 2> /dev/null || echo " $AAB_SIZE bytes" ) MB"
5776else
5877 echo " AAB build failed"
5978 exit 1
0 commit comments