vaenow / cordova-plugin-app-update

App updater for Cordova/PhoneGap
MIT License
299 stars 146 forks source link

App crashes on opening #102

Closed thatsmekaustubh closed 5 years ago

thatsmekaustubh commented 6 years ago

Error says demo has stopped

thats it.

SNIPPET

  onDeviceReady: function() {
        app.receivedEvent('deviceready');
        alert("Device Ready : Attempting update");
        var updateUrl = "http://192.168.1.133/version.xml";
        window.AppUpdate.checkAppUpdate(onSuccess, onFail, updateUrl);
        function onFail() {alert('fail', JSON.stringify(arguments), arguments);}
        function onSuccess() {
            alert('success', JSON.stringify(arguments), arguments);
        }
    }
vaenow commented 6 years ago

Hi, @thatsmekaustubh, thanks for your issue.

please info more error logs here

vaenow commented 6 years ago

Hi @thatsmekaustubh ,

did you miss the PORT ?

- var updateUrl = "http://192.168.1.133/version.xml";
+ var updateUrl = "http://192.168.1.133:PORT/version.xml";
KristianKorsgaard commented 5 years ago

I get a similar error where I'm missing an intent. The following is from the logcat at the crash

09-05 16:34:10.038 3454 3519 E AndroidRuntime: FATAL EXCEPTION: JavaBridge 09-05 16:34:10.038 3454 3519 E AndroidRuntime: Process: com.my.app, PID: 3454 09-05 16:34:10.038 3454 3519 E AndroidRuntime: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSTALL_PACKAGE dat=content://com.my.app.appupdate.provider/download/v9.0.9.apk flg=0x1 VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} } 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1879) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1546) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4284) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:332) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4231) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4568) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4536) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at com.vaenow.appupdate.android.DownloadHandler.installApk(DownloadHandler.java:111) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at com.vaenow.appupdate.android.DownloadHandler.handleMessage(DownloadHandler.java:60) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.os.Looper.loop(Looper.java:158) 09-05 16:34:10.038 3454 3519 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61) 09-05 16:34:10.048 1268 2107 W ActivityManager: Force finishing activity com.my.app/.MainActivity

KristianKorsgaard commented 5 years ago

Related to this StackOverflow https://stackoverflow.com/questions/39332842/no-activity-found-to-handle-intent-when-using-fileprovider, the android version I was building with was wrong. From android 7 and up the intent schema is different, so you need to make sure that you are building for the correct android version. To change this in cordova see https://cordova.apache.org/docs/en/latest/guide/platforms/android/upgrade.html

wenwucn commented 5 years ago

Related to this StackOverflow https://stackoverflow.com/questions/39332842/no-activity-found-to-handle-intent-when-using-fileprovider, the android version I was building with was wrong. From android 7 and up the intent schema is different, so you need to make sure that you are building for the correct android version. To change this in cordova see https://cordova.apache.org/docs/en/latest/guide/platforms/android/upgrade.html

I downgraded cordova android platform to 6.x.x then it works!