apache / incubator-weex-cli

Weex Toolkit is the Standard Tooling for Weex Development.
https://weexteam.github.io/CLI-for-Apache-Weex
Apache License 2.0
564 stars 113 forks source link

Upgrade platform add android project template for v0.28 #596

Open dseeker opened 4 years ago

dseeker commented 4 years ago

The default weex create project with platform android seems to have some native methods no longer supported or that needs revision because of package name changes. Projects using Nat.js library have stopped working with an error related to AbsWeexActivity file in registerBroadcastReceiver.

Your development environment

[✓] Android toolchain - develop for Android devices • Android SDK at /Users/dseeker/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405).

[✓] iOS toolchain - develop for iOS devices • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.2 • CocoaPods version 1.8.4

✔ Weex Cli Environment (v2.0.0-beta.31, on darwin 19.0.0):

[✔] @weex-cli/core - core module for the weex-toolkit [✔] @weex-cli/run - module for running iOS/Android/Web platform with weex-toolkit [✔] @weex-cli/device - module for lanuch device with weex-toolkit [✔] @weex-cli/generator - Generator for weex-toolkit [✔] @weex-cli/doctor - Doctor module for weex-toolkit [✔] @weex-cli/plugin - Module for manage weex plugin and create plugin project [✔] @weex-cli/compile - Plugin for compile weex file.

[vue environment] check if there has Vue packages version mismatch issue

- Which platform (Win/Mac/Ubuntu..)
Mac

## The key error stack message.

⠧ Error: Command failed: ./gradlew clean assembleDebug isLibProject: false, isAppProject: true weex_plugin: [{"dependency":"com.instapp.nat:weex-plugin-device-info:1.0.0-alpha","groupId":"com.instapp.nat","name":"weex-plugin-device-info","type":"maven","version":"1.0.0-alpha"}] add dependency "compile 'com.instapp.nat:weex-plugin-device-info:1.0.0-alpha'" /Users//demoapp/platforms/android/app/src/main/java/com/weex/app/AbsWeexActivity.java:400: error: cannot find symbol filter.addAction(WXSDKInstance.ACTION_DEBUG_INSTANCE_REFRESH); ^ symbol: variable ACTION_DEBUG_INSTANCE_REFRESH location: class WXSDKInstance /Users//demoapp/platforms/android/app/src/main/java/com/weex/app/AbsWeexActivity.java:495: error: cannot find symbol if (WXSDKInstance.ACTION_DEBUG_INSTANCE_REFRESH.equals(intent.getAction())) { ^ symbol: variable ACTION_DEBUG_INSTANCE_REFRESH location: class WXSDKInstance /Users//demoapp/platforms/android/app/src/main/java/com/weex/app/WXPageActivity.java:165: error: cannot find symbol if (TextUtils.equals(errCode, WXErrorCode.WX_DEGRAD_ERR_NETWORK_CHECK_CONTENT_LENGTH_FAILED.getErrorCode())) { ^ symbol: variable WX_DEGRAD_ERR_NETWORK_CHECK_CONTENT_LENGTH_FAILED location: class WXErrorCode Note: /Users//demoapp/platforms/android/app/src/main/java/com/weex/app/AbsWeexActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 errors

FAILURE: Build failed with an exception.

Steps to reproduce the problem.(Maybe a dotwe link)

erha19 commented 4 years ago

@YorkShen please help me to check this problem on https://github.com/weex-templates/weex-playground-android. @dseeker to update the latest template, you can use weex create [project-name] --no-cache command after the problem has been fixed;

YorkShen commented 4 years ago
  1. ./gradlew assembleDebug doesn't work as expceted and I have no clue here. You could try ./gradlew assembleRelease, which works fine. @erha19 @dseeker
  2. As it's said in the change log, there are two release artifacts under two package names. Choose the one that help you solve the problem.
  3. Let's do thing in another way. I have recived lots of complain from ASF that Weex trademark is misused, violated in various projcets. As it's said ASF's policy clearly, Weex is a trademark of ASF, and you can't name a third-party software as Weex XXXX, which is a serious vilolation of ASF trademark and happens in multliple places, unfortunaturely. Just use the offical Weex Playground. And if there is any missing feature, please let me know.