Closed syonip closed 5 years ago
$ unzip Test.apk Archive: Test.apk inflating: META-INF/MANIFEST.MF inflating: META-INF/SHIFTSHA.SF inflating: META-INF/SHIFTSHA.RSA inflating: AndroidManifest.xml inflating: assets/www/cordova-js-src/android/nativeapiprovider.js inflating: assets/www/cordova-js-src/android/promptbasednativeapi.js inflating: assets/www/cordova-js-src/exec.js inflating: assets/www/cordova-js-src/platform.js inflating: assets/www/cordova-js-src/plugin/android/app.js inflating: assets/www/cordova.js inflating: assets/www/cordova_plugins.js inflating: assets/www/css/app.326784ad.css inflating: assets/www/favicon.ico extracting: assets/www/img/logo.82b9c7a5.png inflating: assets/www/index.html inflating: assets/www/js/app.7559e38f.js inflating: assets/www/js/app.7559e38f.js.map inflating: assets/www/js/chunk-vendors.705a545f.js inflating: assets/www/js/chunk-vendors.705a545f.js.map extracting: assets/www/test.csv inflating: classes.dex extracting: res/drawable-land-hdpi-v4/screen.png extracting: res/drawable-land-ldpi-v4/screen.png extracting: res/drawable-land-mdpi-v4/screen.png extracting: res/drawable-land-xhdpi-v4/screen.png extracting: res/drawable-land-xxhdpi-v4/screen.png extracting: res/drawable-land-xxxhdpi-v4/screen.png extracting: res/drawable-port-hdpi-v4/screen.png extracting: res/drawable-port-ldpi-v4/screen.png extracting: res/drawable-port-mdpi-v4/screen.png extracting: res/drawable-port-xhdpi-v4/screen.png extracting: res/drawable-port-xxhdpi-v4/screen.png extracting: res/drawable-port-xxxhdpi-v4/screen.png extracting: res/mipmap-hdpi-v4/icon.png extracting: res/mipmap-ldpi-v4/icon.png extracting: res/mipmap-mdpi-v4/icon.png extracting: res/mipmap-xhdpi-v4/icon.png extracting: res/mipmap-xxhdpi-v4/icon.png extracting: res/mipmap-xxxhdpi-v4/icon.png inflating: res/xml/config.xml extracting: resources.arsc $
The file exists, please simply change
to
.get("test.csv")
This is also explained in the README
Assets and Scripts in vue's public folder need to have a dynamic path, because depending on dev or production build, you have different bases. In dev it's normally '/' and in production it's 'file:///android_asset/www/'. In other words, if you have i.e. an image under 'public/images/me.jpg', the relative url would be img='images/me.jpg'
thanks! I got confused with the slashes...
When running
cordova-serve-android
, I can access a static CSV file in thepublic
folder, but when runningcordova-build-android
and deploying withcordova run android
, the file doesn't exist or isn't accessible in the built app.I made a repo to help reproduce: https://github.com/syonip/cordova-android-error
BTW
cordova-serve-browser
andcordova-build-browser
both work fine.