Giter VIP home page Giter VIP logo

pack-android-tools-for-apache-weex's People

Contributors

erha19 avatar littleseven avatar misakuo avatar

Stargazers

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

Watchers

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

pack-android-tools-for-apache-weex's Issues

使用navagitor 跳转问题,

在使用navagitor的时候无论跳转到什么路径只会去到首页,然后我通过android studio debug,
发现是下面这句报异常了,uri.toString()的值是"file://assets/dist/views/goods.js"
JSONObject initData = new JSONObject(uri.toString());

  • 以下是WXPageActivity的部分(与原版一致,没有改动)
public class WXPageActivity extends AbsWeexActivity implements
    WXSDKInstance.NestedInstanceInterceptor {

  //....

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    //....
    if (uri == null) {
      uri = Uri.parse("{}");
    }
    if (uri != null) {
      try {
       // 这里报异常
        JSONObject initData = new JSONObject(uri.toString());
        String bundleUrl = initData.optString("WeexBundle", null);

  • 这是navagitor的使用
import { Utils } from 'weex-ui'

const navigator = weex.requireModule('navigator')

export default {
  methods: {
    push (path, fn = () => {}) {
      if (Utils.env.isWeb()) {
        this.$router.push(path) // 使用vue-router
      } else {
        const toUrl = weex.config.bundleUrl.split('/').slice(0, -1).join('/') + '/' + path + '.js' // 将a.js的绝对地址转为b.js的绝对地址
        navigator.push({
          'url': toUrl,
          'animated': 'true'
        }, fn)
      }
    },
    
    pop (fn) {
      if (Utils.env.isWeb()) {
        window.history.back()
      } else {
        navigator.pop({
          'animated': 'true'
        }, fn)
      }
    },

    getImgPath(imgName) {
      let platform = weex.config.env.platform.toLowerCase()
      let imgPath = ''
      
      if (platform.indexOf('web') > -1) {
        imgPath = `/static/img/${imgName}`
      } else if (platform.indexOf('android') > -1) {
        // android 不需要后缀
        imgName = imgName.substr(0, imgName.lastIndexOf('.'));
        imgPath = `local:///${imgName}`
      } else {
        imgPath = `../images/${imgName}`
      }

      return imgPath
    }
  }
}

android模版仓库问题

classpath 'com.taobao.android:weexplugin-gradle-plugin:1.1.3-SNAPSHOT'
这个包下载不了,模版里面给出的仓库访问不了,找不到这个包?

how can solve this problem?

(node:6564) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 's tack' of undefined
at C:\Users\Administrator.xtoolkit\node_modules\weexpack\lib\build\android. js:179:21
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:6564) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6564) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

weexplugin工程没有生成

用的是6.3.8
发现weex platform add android后,项目工程代码是生成成功了,但是weexplugin工程没有生成,run也就各种报错了

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.