B
B
BonBon Slick2020-07-31 08:29:08
Android
BonBon Slick, 2020-07-31 08:29:08

Nuxt Cordova Android build infinite loading screen?

The build of the browser platform works fine, except that it opens the index.html start page due to the content .xml of the korodova config. such a no error gives a 404 error in the browser and you need to go to the existing Url in the router.

But the android build, when you run the APK on Android, displays a loading screen, a spinner and that's it.
I will say right away _nuxt has been fixed to nuxt

build: {
    // Disable if non-cordova build

    publicPath: "/nuxt/",
    transpile: [
      'vuetify/lib',
      /(.+)(@company\/library\/src\/utils\/)(.+)(\.js)$/, // Transpile Unix paths for all utils files
      /^vue2-google-maps($|\/)/ // transpile google maps
     ],


  },


How to catch it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BonBon Slick, 2020-07-31
@BonBonSlick

1 - _nuxt to nuxt
2 - rebuild everything before clearing cache and old files

npm generate
#!/bin/bash
 cd dist/
sed -i 's/\/nuxt\//nuxt\//g' index.html
sed -i 's/\/nuxt\//nuxt\//g' nuxt/*.json
sed -i 's/\/nuxt\//nuxt\//g' nuxt/*.js
cd ..
cp -R dist/. cordova/www/
ls
cd cordova/tasks/
./build-android.sh
cd ../
cordova run android

#!/bin/bash
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cd $SCRIPTPATH
cd ../
rm -R --force dist/
npm install
cordova platform rm android
cordova platform add android
cordova prepare
cordova clean
cordova build android
source /etc/environment
$ANDROID_HOME/tools/bin/sdkmanager --licenses
mkdir -p dist
mv platforms/android/app/build/outputs/apk/debug/app-debug.apk dist/android.apk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question