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

QQ登录

只需一步,快速开始

查看: 2235|回复: 9

[处理中3] wex5打包报错

[复制链接]

2

主题

9

帖子

59

积分

初级会员

Rank: 2

积分
59
QQ
发表于 2017-12-21 23:48:33 | 显示全部楼层 |阅读模式
           LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
              ^
        符号:   类 LocationManager
        位置: 类 BaiduLocation
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
              LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
                                                   ^
        符号:   类 LocationManager
        位置: 类 BaiduLocation
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
              LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
                                                                                                           ^
        符号:   变量 Context
        位置: 类 BaiduLocation
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:161: 错误: 找不到符号
              if(myLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
                                                     ^
        符号:   变量 LocationManager
        位置: 类 BaiduLocation
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
              int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
                                                                                                     ^
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
              int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
                                                                                                                                    ^
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:167: 错误: 程序包Settings不存在
              int state = Settings.Secure.getInt(cordova.getActivity().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
                                  ^
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:168: 错误: 程序包Settings不存在
              if (state == Settings.Secure.LOCATION_MODE_OFF) {
                                   ^
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
            ^
        符号:   类 Intent
        位置: 类 BaiduLocation
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                                ^
        符号:   类 Intent
        位置: 类 BaiduLocation
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                                       ^
        符号:   变量 Settings
        位置: 类 BaiduLocation
      :compileDebugJavaWithJavac FAILED
      
      BUILD FAILED
      
      Total time: 1 mins 3.815 secs
      注: 某些输入文件使用或覆盖了已过时的 API。
      注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
      注: 某些输入文件使用了未经检查或不安全的操作。
      注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
      11 个错误
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Execution failed for task ':compileDebugJavaWithJavac'.
      > Compilation failed; see the compiler error output for details.
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      
      H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\cordova\node_modules\q\q.js:126
                          throw e;
                          ^
      Error code 1 for command: cmd with args: /s /c "H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\gradlew cdvBuildDebug -b H:\WeX5_V3.7\model\Native\test\build\src\platforms\android\build.gradle -Dorg.gradle.daemon=true --offline"
      ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
      You may not have the required environment or OS to build this project
      Error: cmd: Command failed with exit code 1
   ****ERROR****: 子任务 "exec" 执行失败。
   ****ERROR****: 任务 "buildAndroid" 执行失败。
   ****ERROR****: 执行出错:
   ****ERROR****: 错误信息: exec returned: 1
   ****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
   C:\Users\Zhang\AppData\Local\Temp\65cd293e-4dcc-49a8-9d67-4ceb0676241c\pack.xml:91: exec returned: 1
           at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
           at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
           at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
           at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
           at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:497)
           at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
           at org.apache.tools.ant.Task.perform(Task.java:348)
           at org.apache.tools.ant.Target.execute(Target.java:435)
           at org.apache.tools.ant.Target.performTasks(Target.java:456)
           at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
           at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
           at com.justep.deploy.app.utils.BuildHelper.execTask(Unknown Source)
           at com.justep.deploy.app.utils.Builder.main(Unknown Source)
****ERROR****: 子任务 "java" 执行失败。
****ERROR****: 任务 "pack" 执行失败。
****ERROR****: 执行出错:
****ERROR****: 错误信息: Java returned: -3
****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
发表于 2017-12-22 14:38:40 | 显示全部楼层
3.7 版本 BaiduLocation 插件的bug
http://docs.wex5.com/wex5-app-question-list-2106/
重新下载:com.justep.cordova.plugin.baidulocation  覆盖本地插件,再次打包试试吧!

或者3.8很快就发布了!欢迎使用最新版本!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

2

主题

9

帖子

59

积分

初级会员

Rank: 2

积分
59
QQ
 楼主| 发表于 2018-1-3 19:56:30 | 显示全部楼层
liangyongfei 发表于 2017-12-22 14:38
3.7 版本 BaiduLocation 插件的bug
http://docs.wex5.com/wex5-app-question-list-2106/
重新下载:com.jus ...

好了,谢啦
回复 支持 反对

使用道具 举报

2

主题

9

帖子

59

积分

初级会员

Rank: 2

积分
59
QQ
 楼主| 发表于 2018-1-3 19:58:32 | 显示全部楼层

require("cordova!cordova-plugin-background-geolocation");//后台定位插件打包失败啊,
按您的方法将 1
#offline=false
改成

1
offline=false
还是不行 啊
回复 支持 反对

使用道具 举报

发表于 2018-1-4 09:51:47 | 显示全部楼层
inn 发表于 2018-1-3 19:58
require("cordova!cordova-plugin-background-geolocation");//后台定位插件打包失败啊,
按您的方法将 1 ...

报什么错?? 意思是使用了cordova-plugin-background-geolocation 打包就报错??  不使用就正常对吗?
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

2

主题

9

帖子

59

积分

初级会员

Rank: 2

积分
59
QQ
 楼主| 发表于 2018-1-4 15:05:04 | 显示全部楼层
liangyongfei 发表于 2018-1-4 09:51
报什么错?? 意思是使用了cordova-plugin-background-geolocation 打包就报错??  不使用就正常对吗?
...

嗯嗯,是的,一使用cordova-plugin-background-geolocation    打包就报错
回复 支持 反对

使用道具 举报

发表于 2018-1-4 15:25:12 | 显示全部楼层
inn 发表于 2018-1-4 15:05
嗯嗯,是的,一使用cordova-plugin-background-geolocation    打包就报错

这样吧!你先试试3.8版本有这个问他吗??
包什么错??  没遇到过因为  这个插件报错的啊
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

2

主题

9

帖子

59

积分

初级会员

Rank: 2

积分
59
QQ
 楼主| 发表于 2018-1-8 10:58:16 | 显示全部楼层
现在是3.8是预览版吗?
报错信息:


环境初始化:

   开始......

   生成应用环境准备:

   android应用环境准备:

   ios应用环境准备:

   生成android应用包:
      Running command: cmd "/s /c "H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\cordova\build.bat --release --gradleArg=--offline""
      ANDROID_HOME=H:\WeX5_V3.7\tools\adt-sdk
      JAVA_HOME=H:\WeX5_V3.7\java\jre1.8
      Running: H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\gradlew cdvBuildRelease -b H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\build.gradle -Dorg.gradle.daemon=true --offline
      Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
      NDK is missing a "platforms" directory.
      If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to H:\WeX5_V3.7\tools\adt-sdk\ndk-bundle.
      If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

      The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
              at build_2ua656db8znw9i6jkjsl6nawv.run(H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\build.gradle:159)
      WARNING: The `android.dexOptions.incremental` property is deprecated and it has no effect on the build process.
      NDK is missing a "platforms" directory.
      If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to H:\WeX5_V3.7\tools\adt-sdk\ndk-bundle.
      If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

      NDK is missing a "platforms" directory.
      If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to H:\WeX5_V3.7\tools\adt-sdk\ndk-bundle.
      If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

      Incremental java compilation is an incubating feature.

      FAILURE: Build failed with an exception.

      * What went wrong:
      A problem occurred configuring root project 'android'.
      > Could not resolve all dependencies for configuration ':_debugApkCopy'.
         > Could not find any matches for com.google.android.gms:play-services-location:+ as no versions of com.google.android.gms:play-services-location are available.
           Required by:
               project :

      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

      BUILD FAILED

      Total time: 18.361 secs
      ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
      You may not have the required environment or OS to build this project

      H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\cordova\node_modules\q\q.js:126
                          throw e;
                          ^
      Error code 1 for command: cmd with args: /s /c "H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\gradlew cdvBuildRelease -b H:\WeX5_V3.7\model\Native\Innenv\build\src\platforms\android\build.gradle -Dorg.gradle.daemon=true --offline"
      Error: cmd: Command failed with exit code 1
   ****ERROR****: 子任务 "exec" 执行失败。
   ****ERROR****: 任务 "buildAndroid" 执行失败。
   ****ERROR****: 执行出错:
   ****ERROR****: 错误信息: exec returned: 1
   ****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html
   C:\Users\Zhang\AppData\Local\Temp\0f141ecf-6aa8-403c-8e7d-def25ac878d1\pack.xml:91: exec returned: 1
           at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
           at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
           at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
           at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
           at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:497)
           at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
           at org.apache.tools.ant.Task.perform(Task.java:348)
           at org.apache.tools.ant.Target.execute(Target.java:435)
           at org.apache.tools.ant.Target.performTasks(Target.java:456)
           at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
           at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
           at com.justep.deploy.app.utils.BuildHelper.execTask(Unknown Source)
           at com.justep.deploy.app.utils.Builder.main(Unknown Source)
****ERROR****: 子任务 "java" 执行失败。
****ERROR****: 任务 "pack" 执行失败。
****ERROR****: 执行出错:
****ERROR****: 错误信息: Java returned: -3
****ERROR****: 如不能确定具体问题,可参考常见问题: http://bbs.wex5.com/thread-82002-1-1.html

回复 支持 反对

使用道具 举报

发表于 2018-1-8 13:55:23 | 显示全部楼层
inn 发表于 2018-1-8 10:58
现在是3.8是预览版吗?
报错信息:

好像是环境的问题! 你先打包平台案例试试可以正常打包吗??
如果不行,建议先用杀毒软件清理下环境,然后退出杀毒软件,再重新打包一下案例试试
案例打包成功后,再打包自己的应用!

这个错误和 cordova-plugin-background-geolocation  没什么关系吧
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

2

主题

9

帖子

59

积分

初级会员

Rank: 2

积分
59
QQ
 楼主| 发表于 2018-1-8 15:49:48 | 显示全部楼层
好的,我再试试
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-26 15:44 , Processed in 0.106766 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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