Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

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

Open
dseeker opened this issue Nov 7, 2019 · 2 comments
Open

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

dseeker opened this issue Nov 7, 2019 · 2 comments

Comments

@dseeker
Copy link

dseeker commented Nov 7, 2019

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.

  • [ x ] If you encounter any problems using the tool, please check if there has a new version to update(Run weex update [pluginname]@latest).
  • [ x ] Check the FAQ, make sure there have not the same issue.

Your development environment

  • Check weex-toolkit verison (Run weex -v)
2.0.0-beta.31 (Core 2.0.0-beta.31)
- @weex-cli/run : v2.0.0-beta.21
- @weex-cli/device : v2.0.0-beta.2
- @weex-cli/generator : v2.0.0-beta.16
- @weex-cli/doctor : v2.0.0-beta.20
- @weex-cli/plugin : v2.0.0-beta.22
- @weex-cli/compile : v2.0.0-beta.27
  • Detact what's wrong with your environment (Run weex doctor)
✔ Android and iOS 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

  - AutoFix vue 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.

* What went wrong:
Execution failed for task ':app: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.

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:198:13)
    at Pipe._handle.close (net.js:606:12)

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

  • Create a new project using weex create
  • Add android and ios platforms
  • Install Nat.js plugin, add Device module weex plugin add nat-device-info
  • Add example code to get basic device information to index.vue
  • npm run android
@erha19
Copy link
Contributor

erha19 commented Nov 13, 2019

@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
Copy link
Contributor

YorkShen commented Nov 13, 2019

  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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants