-
unable to load script from assets ‘index.android bundle’ ,make sure your bundle is packaged correctly or youu’re runing a packager server
解决方法:
mkdir android/app/src/main/assets
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
-
找不到或无法加载主类 org.gradle.wrapper.GradleWrapperMain
解决方法:
由于项目初始化是从dva中下载,猜测大概是andorid中的gradle文件有问题,
所以用其他项目中的gradle文件夹替换,便可运行
- Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
// 操作权限不够,授权
chmod 755 android/gradlew
- react-native-echarts android去除滚动条
修改webview如下:
<WebView
scalesPageToFit={Platform.OS === 'android'}
/>
-
react-native-echarts 打包后android不显示
解决方法:
1. 复制 `/node_modules/native-echarts/src/components/Echarts`
目录下的 tpl.html到
根目录下的 `android/app/src/main/assets`
2. 修改Echarts中webview的source属性,
代码如下:
const source = (Platform.OS == 'ios') ? require('./tpl.html') : { uri: 'file:///android_asset/tpl.html' }
<WebView
source={source}
/>