Code Monkey home page Code Monkey logo

react-native-smartassets's People

Contributors

smallnew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-smartassets's Issues

iOS 热更后找不到主bundle的图片

Hi,IOS 热更后,现象如题

环境
ios 12.4.3
iphone 6plus
react native 0.61.5

初始化
`import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';

import {SmartAssets} from 'react-native-smartassets';
SmartAssets.initSmartAssets();

AppRegistry.registerComponent(appName, () => App);`

测试后发现 android 能正常显示,ios 则不能,没有找到合适的调试方法,就直接alert,最后发现
是路径拼接的有问题 ,我自己改了下,改好了,
改的地方如下

const defaultMainBundePath = Smartassets.DefaultMainBundlePath; // 原来被注释掉了,加回来
...
...
let oriJsBundleUrl = 'file://'+defaultMainBundePath+'/'+iOSRelateMainBundlePath + "/"; // 默认缺了一个 / 符号,加上

改动后,一切正常了

看下是不是还有更合适的方法

Android 使用后图片显示,ios还是不行

SmartAssets.setiOSRelateMainBundlePath('./ios/platform.ios.bundle');
SmartAssets.setiOSRelateMainBundlePath('./ios/index.ios.bundle');
试了这两种写法,都不行,大神指点一下奥

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.