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

试图升级报错 修改0.16.0 为 compile 'com.taobao.android:weex_sdk:0.18.0' #1694

Closed
noman798 opened this issue Nov 2, 2018 · 3 comments

Comments

@noman798
Copy link
Contributor

noman798 commented Nov 2, 2018

compile 'com.taobao.android:weex_sdk:0.18.0'

报错如下

11:13:20 : Error: Error: Command failed: ./gradlew assembleDebug
isLibProject: false, isAppProject: true
weex_plugin: []
/Users/z/git/phone.life/platforms/android/app/src/main/java/com/weex/app/WXPageActivity.java:166: 错误: 找不到符号
if (TextUtils.equals(errCode, WXRenderErrorCode.WX_NETWORK_ERROR)) {
^
符号: 变量 WX_NETWORK_ERROR
位置: 类 WXRenderErrorCode
/Users/z/git/phone.life/platforms/android/app/src/main/java/com/weex/app/WXPageActivity.java:240: 错误: 找不到符号
WXSDKEngine.switchDebugModel(true, debug_url);
^
符号: 方法 switchDebugModel(boolean,String)
位置: 类 WXSDKEngine
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
2 个错误

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. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 10s

at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at /Users/z/.xtoolkit/node_modules/weexpack/lib/run/android.js:331:20
at new Promise (<anonymous>)
at buildApp (/Users/z/.xtoolkit/node_modules/weexpack/lib/run/android.js:327:10)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

image

@noman798
Copy link
Contributor Author

noman798 commented Nov 2, 2018

我做了如下的修改,能编译了

但是安卓运行后显示

render error:1001

这怎么解决?

--- a/platforms/android/app/src/main/java/com/weex/app/WXPageActivity.java
+++ b/platforms/android/app/src/main/java/com/weex/app/WXPageActivity.java
@@ -15,18 +15,17 @@ import android.widget.ProgressBar;
 import android.widget.TextView;
 import android.widget.Toast;

-import com.weex.app.hotreload.HotReloadManager;
-import com.weex.app.util.AppConfig;
-import com.weex.app.util.Constants;
 import com.google.zxing.integration.android.IntentIntegrator;
 import com.google.zxing.integration.android.IntentResult;
 import com.taobao.weex.WXEnvironment;
-import com.taobao.weex.WXRenderErrorCode;
 import com.taobao.weex.WXSDKEngine;
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.ui.component.NestedContainer;
 import com.taobao.weex.utils.WXLogUtils;
 import com.taobao.weex.utils.WXSoInstallMgrSdk;
+import com.weex.app.hotreload.HotReloadManager;
+import com.weex.app.util.AppConfig;
+import com.weex.app.util.Constants;

 import org.json.JSONException;
 import org.json.JSONObject;
@@ -163,7 +162,7 @@ public class WXPageActivity extends AbsWeexActivity implements
   public void onException(WXSDKInstance instance, String errCode, String msg) {
     mProgressBar.setVisibility(View.GONE);
     mTipView.setVisibility(View.VISIBLE);
-    if (TextUtils.equals(errCode, WXRenderErrorCode.WX_NETWORK_ERROR)) {
+    if (TextUtils.equals(errCode, "wx_network_error")) {
       mTipView.setText(R.string.index_tip);
     } else {
       mTipView.setText("render error:" + errCode);
@@ -237,7 +236,10 @@ public class WXPageActivity extends AbsWeexActivity implements
       } else if (code.contains("_wx_debug")) {
         uri = Uri.parse(code);
         String debug_url = uri.getQueryParameter("_wx_debug");
-        WXSDKEngine.switchDebugModel(true, debug_url);
+
+        WXEnvironment.sRemoteDebugMode =true;
+        WXEnvironment.sRemoteDebugProxyUrl = debug_url;
+
         finish();
       } else {

@noman798
Copy link
Contributor Author

noman798 commented Nov 2, 2018

想升级19.0.3 结果编译不过见截图

image

@YorkShen
Copy link
Contributor

YorkShen commented Dec 7, 2018

#1694

Sorry the delay, you can use compile 'com.taobao.android:weex_sdk:0.19.0.7'. I have checked, it worked well

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

No branches or pull requests

3 participants