起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4513|回复: 12

[结贴] 打包出错,请指导!

[复制链接]

265

主题

614

帖子

1171

积分

金牌会员

Rank: 6Rank: 6

积分
1171
QQ
发表于 2017-10-22 23:49:30 | 显示全部楼层 |阅读模式
我的应用需要读取经、纬度信息,根据教程,加了插件,但打包时出错,请问是什么原因?
  1. D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
  2.               LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
  3.               ^
  4.         符号:   类 LocationManager
  5.         位置: 类 BaiduLocation
  6.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
  7.               LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
  8.                                                    ^
  9.         符号:   类 LocationManager
  10.         位置: 类 BaiduLocation
  11.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
  12.               LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
  13.                                                                                                            ^
  14.         符号:   变量 Context
  15.         位置: 类 BaiduLocation
  16.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:161: 错误: 找不到符号
  17.               if(myLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
  18.                                                      ^
  19.         符号:   变量 LocationManager
  20.         位置: 类 BaiduLocation
  21.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
  22.               int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
  23.                                                                                                      ^
  24.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
  25.               int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
  26.                                                                                                                                     ^
  27.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
  28.               int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
  29.                                   ^
  30.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:168: 错误: 程序包Settings不存在
  31.               if (state == Settings.Secure.LOCATION_MODE_OFF) {
  32.                                    ^
  33.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
  34.             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  35.             ^
  36.         符号:   类 Intent
  37.         位置: 类 BaiduLocation
  38.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
  39.             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  40.                                 ^
  41.         符号:   类 Intent
  42.         位置: 类 BaiduLocation
  43.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
  44.             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  45.                                        ^
  46.         符号:   变量 Settings
  47.         位置: 类 BaiduLocation
  48.       注: 某些输入文件使用或覆盖了已过时的 API。
  49.       注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
  50.       注: 某些输入文件使用了未经检查或不安全的操作。
  51.       注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
  52.       11 个错误
  53.       
  54.       FAILURE: Build failed with an exception.
  55.       
  56.       * What went wrong:
  57.       Execution failed for task ':compileReleaseJavaWithJavac'.
  58.       > Compilation failed; see the compiler error output for details.
  59.       
  60.       * Try:
  61.       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  62.       :compileReleaseJavaWithJavac FAILED
  63.       
  64.       BUILD FAILED
  65.       
  66.       Total time: 15.005 secs
  67.       ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
  68.       You may not have the required environment or OS to build this project
  69.       
  70.       D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\cordova\node_modules\q\q.js:126
  71.                           throw e;
  72.                           ^
  73.       Error code 1 for command: cmd with args: /s /c "D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\gradlew cdvBuildRelease -b D:\WeX5_V3.7\model\Native\myxny\build\src\platforms\android\build.gradle -Dorg.gradle.daemon=true --offline"
  74.       Error: cmd: Command failed with exit code 1
  75.    ****ERROR****: 子任务 "exec" 执行失败。
  76.    ****ERROR****: 任务 "buildAndroid" 执行失败。
  77.    ****ERROR****: 执行出错:
  78.    ****ERROR****: 错误信息: exec returned: 1
  79.    ****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
  80.    C:\Users\ADMINI~1\AppData\Local\Temp\2\94ec491a-e32b-4cf8-b905-084f878e5595\pack.xml:91: exec returned: 1
  81.            at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
  82.            at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
  83.            at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
  84.            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
  85.            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  86.            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  87.            at java.lang.reflect.Method.invoke(Method.java:497)
  88.            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  89.            at org.apache.tools.ant.Task.perform(Task.java:348)
  90.            at org.apache.tools.ant.Target.execute(Target.java:435)
  91.            at org.apache.tools.ant.Target.performTasks(Target.java:456)
  92.            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
  93.            at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
  94.            at com.justep.deploy.app.utils.BuildHelper.execTask(Unknown Source)
  95.            at com.justep.deploy.app.utils.Builder.main(Unknown Source)
  96. ****ERROR****: 子任务 "java" 执行失败。
  97. ****ERROR****: 任务 "pack" 执行失败。
  98. ****ERROR****: 执行出错:
  99. ****ERROR****: 错误信息: Java returned: -3
  100. ****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
复制代码



发表于 2017-10-23 11:08:33 | 显示全部楼层
平台案例打包正常吗?
http://docs.wex5.com/cordova-plugin-geolocation/

你是不是修改过插件的源码呢??
看上去是插件编译通不过了!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

265

主题

614

帖子

1171

积分

金牌会员

Rank: 6Rank: 6

积分
1171
QQ
 楼主| 发表于 2017-10-23 14:29:33 | 显示全部楼层
平台案例,记帐本打包是成功的,外卖不成功。
我只改过:attachmentSimple.js , 但调试是通过的,改的代码也比较简单:
  1.                                 //原来的函数
  2.                                 //var storeFileName = (new justep.UUID()).valueOf();
  3.                                 //名称修改:-----------------------
  4.                                 var lDate = new Date() ;
  5.                                 var lstr = "P"+self.formatDate(lDate,"yyMMdd") + "" + Math.random().toString(16).substr(3) ;
  6.                                 var storeFileName = lstr ;
  7.                                 event.file.data = {
  8.                                         fileName : event.file.name,
  9.                                         storeFileName : storeFileName,
  10.                                         ownerID : self.getOwnerID()
  11.                                 };
  12.                                 //修改结束------------------------       
复制代码
打包后,也运行 \tools\dist\dist.bat 合并资源了。
这个会影响打包吗?


回复 支持 反对

使用道具 举报

发表于 2017-10-23 14:33:34 | 显示全部楼层
yczxqy 发表于 2017-10-23 14:29
平台案例,记帐本打包是成功的,外卖不成功。
我只改过:attachmentSimple.js , 但调试是通过的,改的代码 ...

这个不影响打包的!
报错信息是因为这个插件
build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java

编译java代码报错了!
编译通不过了!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

265

主题

614

帖子

1171

积分

金牌会员

Rank: 6Rank: 6

积分
1171
QQ
 楼主| 发表于 2017-10-23 14:50:39 | 显示全部楼层
这个我没有修改,我目前也没有能力修改。
现在怎么办呢?
回复 支持 反对

使用道具 举报

265

主题

614

帖子

1171

积分

金牌会员

Rank: 6Rank: 6

积分
1171
QQ
 楼主| 发表于 2017-10-23 14:55:54 | 显示全部楼层
对了,我 wex5 现在的版本是: 3.7 ,这个跟版本应该没有关系吧
回复 支持 反对

使用道具 举报

发表于 2017-10-23 15:06:25 | 显示全部楼层
yczxqy 发表于 2017-10-23 14:55
对了,我 wex5 现在的版本是: 3.7 ,这个跟版本应该没有关系吧

那你测试一下!打包一个测试页面!。里面引用 这个插件
com.justep.cordova.plugin.baidulocation

或者打包外卖案例试试正常吗??
如果也不正常,建议重新解压个版本试试吧!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

265

主题

614

帖子

1171

积分

金牌会员

Rank: 6Rank: 6

积分
1171
QQ
 楼主| 发表于 2017-10-23 15:28:57 | 显示全部楼层
外卖打包也失败。
我重新下载3.7版本试试。
回复 支持 反对

使用道具 举报

265

主题

614

帖子

1171

积分

金牌会员

Rank: 6Rank: 6

积分
1171
QQ
 楼主| 发表于 2017-10-23 15:48:39 | 显示全部楼层
重新下载 3.7 版本,解压后,打包:外卖程序,还是出错:
  1. D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
  2.               LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
  3.               ^
  4.         符号:   类 LocationManager
  5.         位置: 类 BaiduLocation
  6.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
  7.               LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
  8.                                                    ^
  9.         符号:   类 LocationManager
  10.         位置: 类 BaiduLocation
  11.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
  12.               LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
  13.                                                                                                            ^
  14.         符号:   变量 Context
  15.         位置: 类 BaiduLocation
  16.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:161: 错误: 找不到符号
  17.               if(myLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
  18.                                                      ^
  19.         符号:   变量 LocationManager
  20.         位置: 类 BaiduLocation
  21.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
  22.               int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
  23.                                                                                                      ^
  24.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
  25.               int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
  26.                                                                                                                                     ^
  27.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
  28.               int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
  29.                                   ^
  30.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:168: 错误: 程序包Settings不存在
  31.               if (state == Settings.Secure.LOCATION_MODE_OFF) {
  32.                                    ^
  33.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
  34.             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  35.             ^
  36.         符号:   类 Intent
  37.         位置: 类 BaiduLocation
  38.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
  39.             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  40.                                 ^
  41.         符号:   类 Intent
  42.         位置: 类 BaiduLocation
  43.       D:\WeX5_V3.71\model\Native\外卖\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
  44.             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  45.                                        ^
  46.         符号:   变量 Settings
  47.         位置: 类 BaiduLocation
  48.       :compileReleaseJavaWithJavac FAILED
  49.       注: 某些输入文件使用或覆盖了已过时的 API。
  50.       注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
  51.       注: 某些输入文件使用了未经检查或不安全的操作。
  52.       注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
  53.       11 个错误
  54.       
  55.       BUILD FAILED
  56.       
  57.       Total time: 28.648 secs
  58.       
  59.       FAILURE: Build failed with an exception.
  60.       
  61.       * What went wrong:
  62.       Execution failed for task ':compileReleaseJavaWithJavac'.
  63.       > Compilation failed; see the compiler error output for details.
  64.       
  65.       * Try:
  66.       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  67.    C:\Users\ADMINI~1\AppData\Local\Temp\0ae105c3-19d0-47fc-bd7f-14dea21957cc\pack.xml:91: exec returned: 1
  68.            at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
  69.            at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
  70.            at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
  71.            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
  72.            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  73.            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  74.            at java.lang.reflect.Method.invoke(Method.java:497)
  75.            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  76.            at org.apache.tools.ant.Task.perform(Task.java:348)
  77.            at org.apache.tools.ant.Target.execute(Target.java:435)
  78.            at org.apache.tools.ant.Target.performTasks(Target.java:456)
  79.            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
  80.            at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
  81.            at com.justep.deploy.app.utils.BuildHelper.execTask(Unknown Source)
  82.            at com.justep.deploy.app.utils.Builder.main(Unknown Source)
  83.       ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
  84.       You may not have the required environment or OS to build this project
  85.       
  86.       D:\WeX5_V3.71\model\Native\澶栧崠\build\src\platforms\android\cordova\node_modules\q\q.js:126
  87.                           throw e;
  88.                           ^
  89.       Error code 1 for command: cmd with args: /s /c "D:\WeX5_V3.71\model\Native\澶栧崠\build\src\platforms\android\gradlew cdvBuildRelease -b D:\WeX5_V3.71\model\Native\澶栧崠\build\src\platforms\android\build.gradle -Dorg.gradle.daemon=true --offline"
  90.       Error: cmd: Command failed with exit code 1
  91.    ****ERROR****: 子任务 "exec" 执行失败。
  92.    ****ERROR****: 任务 "buildAndroid" 执行失败。
  93.    ****ERROR****: 执行出错:
  94.    ****ERROR****: 错误信息: exec returned: 1
  95.    ****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
  96. ****ERROR****: 子任务 "java" 执行失败。
  97. ****ERROR****: 任务 "pack" 执行失败。
  98. ****ERROR****: 执行出错:
  99. ****ERROR****: 错误信息: Java returned: -3
  100. ****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
复制代码



回复 支持 反对

使用道具 举报

发表于 2017-10-23 16:01:42 | 显示全部楼层
yczxqy 发表于 2017-10-23 15:48
重新下载 3.7 版本,解压后,打包:外卖程序,还是出错:

请问你的wex5 版本号是多少??本地也是wex5 3.7 打包 外卖 案例 是  正常的!

版本: 5.3.7.6152

加你qq了!要不给你发一个版本,和我一样的版本试试
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-7-2 07:43 , Processed in 0.068248 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表