wl 6.1中的worklight apk中缺少dojo/_base/* js [英] dojo/_base/*js missing from worklight apk in wl 6.1

查看:95
本文介绍了wl 6.1中的worklight apk中缺少dojo/_base/* js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用WL 6.1创建的混合应用程序,它使用了随附的dojolib.目前,它正在为iPhone生产,我们正在为其添加Android风格.从控制台上的移动模拟器运行代码时,android和iphone都可以正常工作.ipa文件可以正常工作.当我在Android设备(三星S4)上运行混合动力车时,应用程序在登录应用程序启动时引发错误.我已关闭提供dojo库".在DDMS日志中,我看到类似以下的语句:

I have a hybrid app that was created with WL 6.1 that uses the included dojolib. Currently it is in production for iphone and we are adding the android flavor of it. When running the code from the mobile simulator on the console, both the android and iphone work fine. The ipa file works fine. When I run the hybrid on an android device (Samsung S4), the application throws errors in the log on app startup. I have the "provide dojo libraries" turned off. In the DDMS log I see statements like the following:

09-09 12:47:12.092: E/AndroidProtocolHandler(20324): Unable to open asset URL: file:///android_asset/www/default/dojo/_base/declare.js
09-09 12:47:12.263: E/AndroidProtocolHandler(20324): Unable to open asset URL: file:///android_asset/www/default/dojo/_base/connect.js
09-09 12:47:12.303: E/AndroidProtocolHandler(20324): Unable to open asset URL: file:///android_asset/www/default/dojo/_base/event.js

在eclipse中的android项目中,我在"assets/www/default/dojo/_base"目录中看到了这些文件.问题是当我查看APK文件时,"_ base"目录不存在.对了解为什么缺少它有帮助吗?

Looking out in the android project in eclipse, I see those files in the "assets/www/default/dojo/_base" directory. The issue is when I look in the APK file, the "_base" directory is not there. Any help as to understanding why it is missing?

推荐答案

我还找到了另一种解决android打包错误的方法.如前所述,一种方法是使用DojoBuildFactory创建一个新层,将文件嵌入其中.这与WL用于创建核心Web层和移动UI层的过程相同.我有一个团队在处理这个问题,但是文档非常少,而且是一个非常耗时的过程.

I've also found an alternative way to get around the android packaging bug. As I mentioned earlier one way is to use the DojoBuildFactory to create a new layer that would have the files imbedded in them. This is the same process that WL uses to create the core-web-layer and mobile-ui-layer. I have a team working on this, but the documentation is ... scant and it is a time consuming process.

他们这样做的时候,我发现我认为是解决此问题的一种更干净的方法.有效地打开未签名的apk,插入文件,然后对APK进行签名.像魅力一样工作.这是我使用的步骤:

While they were doing that, I found what I think is a cleaner way of addressing the issue. Effectively open up an unsigned apk, insert the files, and then sign the APK. Worked like a charm. Here are the steps I used:

  • 从工作指向正确的worklight服务器并在缺少提供的dojo库的情况下进行构建
  • 作为未签名的APK导出为Android项目
  • 使用正确的env设置打开指向JDK和ADT的命令提示符
  • 创建密钥库(如果尚未创建)
  • 使用jar解压缩为临时文件
  • 从android/native/www/default复制dojo文件
  • 使用jar将其打包回apk
  • 在罐子上签名
  • 压缩罐子

现在您有一个工作的apk,其中包括资产中以"_"开头的文件/目录.

Now you have a working apk that includes the files/directories in asset that begin with a "_".

这篇关于wl 6.1中的worklight apk中缺少dojo/_base/* js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆