App update does not working

Config.xml
<widget id="io.ionic.starter" version="3.2.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { Network } from '@ionic-native/network';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { AppUpdate } from '@ionic-native/app-update';
import { AppVersion } from '@ionic-native/app-version';
@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    BrowserModule,
	IonicModule.forRoot(MyApp,{
		mode: 'ios',
		backButtonText: ''
	})
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    StatusBar,Network,AppVersion,
    SplashScreen,AppUpdate,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

app.component.ts

import { Component } from '@angular/core';
import { Platform,ToastController, } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Network } from '@ionic-native/network';
import { HomePage } from '../pages/home/home';
import { AppUpdate } from '@ionic-native/app-update';
import { AppVersion } from '@ionic-native/app-version';
@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = HomePage;

  constructor(
	private appVersion: AppVersion,
	private appUpdate: AppUpdate,
	platform: Platform, 
	statusBar: StatusBar, 
	splashScreen: SplashScreen,
	public network: Network,
	public toastCtrl: ToastController
	) {
    
	platform.ready().then(() => {
		this.apUpdate();
		statusBar.styleDefault();
		splashScreen.hide();
    });
  }
  apUpdate(){
		const updateUrl = 'https://domain.com/api/update.xml';
		this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') });
	}
}

AndroidMenifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="30204" android:versionName="3.2.4" package="io.ionic.starter" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <provider android:authorities="${applicationId}.appupdate.provider" android:exported="false" android:grantUriPermissions="true" android:name="com.vaenow.appupdate.android.GenericFileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/appupdate_paths" />
        </provider>
    </application>
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="26" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
</manifest>

update.xml

<update>
    <version>302048</version>
    <name>school-302048</name>
    <url>http://domain.com/school-302048.apk</url>
</update>

I am missing something somewhere. Is my process wrong. In mobile app is stopping.

1 Like

What exactly happens when you launch the app?

school(app name) has stopped.

I have the same issue. Once implement ionic-native/app-update then app stop working.

Same problem here, you solved it?