|
楼主 |
发表于 2017-9-6 16:31:49
|
显示全部楼层
使用最新的3.7版本,有点奇怪
在V3.7打包仿淘宝,打包APK是成功,打包过程报错
D:\wex5_3.7\model\Native\仿淘宝\build\src\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:567: Error: Expected resource of type id [ResourceType]
back.setId(2);
~
D:\wex5_3.7\model\Native\仿淘宝\build\src\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:591: Error: Expected resource of type id [ResourceType]
forward.setId(3);
~
D:\wex5_3.7\model\Native\仿淘宝\build\src\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:614: Error: Expected resource of type id [ResourceType]
edittext.setId(4);
~
D:\wex5_3.7\model\Native\仿淘宝\build\src\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:637: Error: Expected resource of type id [ResourceType]
close.setId(5);
~
D:\wex5_3.7\model\Native\仿淘宝\build\src\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:683: Error: Expected resource of type id [ResourceType]
inAppWebView.setId(6);
~
Explanation for issues of type "ResourceType":
Ensures that resource id's passed to APIs are of the right type; for
example, calling Resources.getColor(R.string.name) is wrong.
6 errors, 0 warnings
打包自己的项目,打包APK都没成功,报错:
:compileReleaseJavaWithJavac
:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
^
符号: 类 LocationManager
位置: 类 BaiduLocation
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
^
符号: 类 LocationManager
位置: 类 BaiduLocation
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:160: 错误: 找不到符号
LocationManager myLocationManager = (LocationManager) cordova.getActivity().getSystemService(Context.LOCATION_SERVICE);
^
符号: 变量 Context
位置: 类 BaiduLocation
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:161: 错误: 找不到符号
if(myLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
^
符号: 变量 LocationManager
位置: 类 BaiduLocation
D:\wex5_3.7\model\Native\zchj\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);
^
D:\wex5_3.7\model\Native\zchj\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);
^
D:\wex5_3.7\model\Native\zchj\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);
^
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:168: 错误: 程序包Settings不存在
if (state == Settings.Secure.LOCATION_MODE_OFF) {
^
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
^
符号: 类 Intent
位置: 类 BaiduLocation
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
^
符号: 类 Intent
位置: 类 BaiduLocation
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\src\com\justep\cordova\plugin\baidulocation\BaiduLocation.java:177: 错误: 找不到符号
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
^
符号: 变量 Settings
位置: 类 BaiduLocation
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
11 个错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> 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.
:compileReleaseJavaWithJavac FAILED
BUILD FAILED
Total time: 40.071 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
D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\wex5_3.7\model\Native\zchj\build\src\platforms\android\gradlew cdvBuildRelease -b D:\wex5_3.7\model\Native\zchj\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 |
|