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

Download Mode isn't work? #4013

Open
Lua12138 opened this issue Oct 19, 2017 · 0 comments
Open

Download Mode isn't work? #4013

Lua12138 opened this issue Oct 19, 2017 · 0 comments

Comments

@Lua12138
Copy link

I try to do with Getting Started

  • CrossWalk Version: 23.53.589.4
  • Android Version: API 19
public class MainActivity extends XWalkActivity implements XWalkInitializer.XWalkInitListener,
        XWalkUpdater.XWalkBackgroundUpdateListener {
    private XWalkView browser;
    private XWalkResourceClient resourceClient;
    private XWalkUIClient uiClient;
    XWalkInitializer mXWalkInitializer;
    XWalkUpdater mXWalkUpdater;

    protected final static String TAG = "[MainActivity]";

    @Override
    protected void onXWalkReady() {
        Log.d(TAG, "onXWalkReady");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mXWalkInitializer = new XWalkInitializer(this, this);
        mXWalkInitializer.initAsync();

        this.setContentView(R.layout.main_activity);

        this.browser = (XWalkView) findViewById(R.id.browser);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mXWalkInitializer.initAsync();
    }

    @Override
    public void onXWalkInitStarted() {
    }

    @Override
    public void onXWalkInitCancelled() {
        Log.e(TAG, "onXWalkInitCancelled");
        finish();
    }

    @Override
    public void onXWalkInitFailed() {
        // Initialization failed. Trigger the Crosswalk runtime download
        if (mXWalkUpdater == null) {
            mXWalkUpdater = new XWalkUpdater(this, this);
        }
        mXWalkUpdater.updateXWalkRuntime();
    }

    @Override
    public void onXWalkInitCompleted() {
        // Initialization successfully, ready to invoke any XWalk embedded API
    }

    @Override
    public void onXWalkUpdateStarted() {
    }

    @Override
    public void onXWalkUpdateProgress(int percentage) {
        Log.d(TAG, "XWalkUpdate progress: " + percentage);
    }

    @Override
    public void onXWalkUpdateCancelled() {
        Log.e(TAG, "onXWalkUpdateCancelled");
        finish();
    }

    @Override
    public void onXWalkUpdateFailed() {
        Log.e(TAG, "onXWalkUpdateFailed");
        finish();
    }

    @Override
    public void onXWalkUpdateCompleted() {
        // Crosswalk Runtime update finished, re-init again.
        mXWalkInitializer.initAsync();
    }
}

But it failed. Here is the logcat:

10-19 18:06:50.493 15837-15837/? D/dalvikvm: Late-enabling CheckJNI
10-19 18:06:50.517 15837-15837/? D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
10-19 18:06:50.517 15837-15837/? W/dalvikvm: VFY: unable to resolve static field 426 (SUPPORTED_ABIS) in Landroid/os/Build;
10-19 18:06:50.517 15837-15837/? D/dalvikvm: VFY: replacing opcode 0x62 at 0x0004
10-19 18:06:50.517 15837-15837/? D/XWalkLib: Pre init xwalk core in com.github.gam2046.platform.united.browser.MainActivity
10-19 18:06:50.517 15837-15837/? D/XWalkLib: Pre init xwalk core in com.github.gam2046.platform.united.browser.MainActivity
10-19 18:06:50.517 15837-15837/? D/XWalkLib: Initialized by XWalkInitializer
10-19 18:06:50.521 15837-15837/? D/XWalkLib: DecompressTask started
10-19 18:06:50.521 15837-15837/? W/ResourceType: No package identifier when getting value for resource number 0x00000000
10-19 18:06:50.577 15837-15837/? D/XWalkLib: Reserve object class org.xwalk.core.XWalkView to com.github.gam2046.platform.united.browser.MainActivity
10-19 18:06:50.577 15837-15837/? D/XWalkLib: Other initialization or download is proceeding
10-19 18:06:50.577 15837-15837/? D/XWalkLib: Other initialization or download is proceeding
10-19 18:06:50.581 15837-15837/? D/XWalkLib: DecompressTask finished, 0
10-19 18:06:50.581 15837-15837/? D/XWalkLib: ActivateTask started
10-19 18:06:50.597 15837-15932/? D/XWalkLib: Attach xwalk core
10-19 18:06:50.597 15837-15932/? D/XWalkLib: [Environment] SDK:19
10-19 18:06:50.601 15837-15932/? D/XWalkLib: [App Version] build:23.53.589.4, api:8, min_api:1
10-19 18:06:50.609 15837-15932/? D/XWalkLib: XWalk core not found
10-19 18:06:50.613 15837-15837/? D/libEGL: loaded /system/lib/egl/libEGL_adreno.so
                                           
                                           [ 10-19 18:06:50.613 15837:15837 D/         ]
                                           HostConnection::get() New Host Connection established 0xb85d73b8, tid 15837
10-19 18:06:50.613 15837-15837/? D/libEGL: loaded /system/lib/egl/libGLESv1_CM_adreno.so
10-19 18:06:50.617 15837-15837/? D/libEGL: loaded /system/lib/egl/libGLESv2_adreno.so
10-19 18:06:50.625 15837-15932/? D/XWalkLib: Crosswalk download mode: true
10-19 18:06:50.629 15837-15932/? D/XWalkLib: [Environment] SDK:19
10-19 18:06:50.629 15837-15932/? D/XWalkLib: [App Version] build:23.53.589.4, api:8, min_api:1
10-19 18:06:50.629 15837-15932/? D/XWalkLib: XWalk core not found
10-19 18:06:50.657 15837-15837/? W/EGL_adreno: eglSurfaceAttrib not implemented
10-19 18:06:50.657 15837-15837/? E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache
10-19 18:06:50.669 15837-15837/? E/OpenGLRenderer: MAX_TEXTURE_SIZE: 16384
10-19 18:06:50.681 15837-15837/? E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
10-19 18:06:50.685 15837-15837/? E/OpenGLRenderer: MAX_TEXTURE_SIZE: 16384
10-19 18:06:50.685 15837-15837/? D/OpenGLRenderer: Enabling debug mode 0
10-19 18:06:50.845 15837-15837/? D/XWalkLib: ActivateTask finished, 2
10-19 18:06:50.849 15837-15837/? D/XWalkLib: Runtime ABI: x86
10-19 18:06:50.849 15837-15837/? D/XWalkLib: Crosswalk APK download URL: http://localhost:8080/download.apk?arch=x86
10-19 18:06:50.849 15837-15837/? D/XWalkLib: HttpDownloadTask started, http://localhost:8080/download.apk?arch=x86
10-19 18:06:50.925 15837-15901/? D/dalvikvm: GC_CONCURRENT freed 169K, 8% free 2969K/3200K, paused 12ms+5ms, total 22ms
10-19 18:06:51.001 15837-15837/? D/XWalkLib: HttpDownloadTask finished, -1
10-19 18:06:51.001 15837-15837/? E/[MainActivity]: onXWalkUpdateFailed

I'm sure that my web service works:

$ curl -I http://localhost:8080/download.apk?arch=x86
HTTP/1.1 200 
Content-Disposition: attachment;filename=app-x86-release.apk
Content-Type: application/octet-stream
Content-Length: 29795980
Date: Thu, 19 Oct 2017 10:14:02 GMT

Am i something wrong?

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

1 participant