Hi Guys,
I have integrated AOT compiler in my ionic project.
I use below command while build .apk file:
"node_modules/.bin/ngc" -p tsconfig-aot.json
"node_modules/.bin/rollup" -c rollup-config.js
ionic cordova build android
but while using same command with --prod flag it gives me below logs:
ionic cordova build android --prod
[INFO] Running app-scripts build: --prod --platform android --target cordova
[17:43:35] build prod started ...
[17:43:35] clean started ...
[17:43:35] clean finished in 5 ms
[17:43:35] copy started ...
[17:43:35] ngc started ...
[17:43:53] Failed to parse and update D:\Projects\Code\Hybrid Mobile App\DailySheet\src\app\main.ts content for AoT
compilation. For now, the default fallback content will be used instead. Please consider updating
D:\Projects\Code\Hybrid Mobile App\DailySheet\src\app\main.ts with the content from the following link:
https://github.com/ionic-team/ionic2-app-base/tree/master/src/app/main.ts
[17:43:59] ngc finished in 23.38 s
[17:43:59] preprocess started ...
[17:43:59] deeplinks started ...
[17:44:00] deeplinks finished in 1.06 s
[17:44:00] optimization started ...
[17:44:03] copy finished in 27.85 s
[17:44:26] optimization finished in 26.21 s
[17:44:26] preprocess finished in 27.28 s
[17:44:26] webpack started ...
[17:44:58] webpack finished in 31.98 s
[17:44:58] sass started ...
[17:44:58] uglifyjs started ...
[17:45:03] sass finished in 5.34 s
[17:45:03] cleancss started ...
[17:45:08] cleancss finished in 5.07 s
[17:46:19] uglifyjs finished in 81.17 s
[17:46:19] postprocess started ...
[17:46:19] removed unused font files
[17:46:19] postprocess finished in 156 ms
[17:46:19] lint started ...
[17:46:19] build prod finished in 164.21 s
> ionic cordova prepare
> cordova prepare
ā Running command - done!
> cordova build android
| Running command [17:47:36] tslint: D:/Projects/Code/Hybrid Mobile App/DailySheet/src/pages/Units/Units.ts, line: 281
Duplicate variable: 'unit'
L280: if (flag) {
/ Running command L281: for (var unit of array) {
L282: if (unit.UnitId == Unit.UnitId) {
[17:47:36] tslint: D:/Projects/Code/Hybrid Mobile App/DailySheet/src/pages/Worker/Workers.ts, line: 142
Duplicate variable: 'worker'
L141: if (flag) {
L142: for (var worker of array) {
L143: if (worker.WorkerId == Worker.WorkerId) {
[17:47:36] lint finished in 76.82 s
ā Running command - done!
ANDROID_HOME=D:\Softwares\Programing\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_cuh8avru5p0udzrxkx14hyufn.run(D:\Projects\Code\Hybrid Mobile App\DailySheet\platforms\android\build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preDebugAndroidTestBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders UP-TO-DATE
:CordovaLib:compileReleaseShaders UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportV132510Library UP-TO-DATE
:prepareComAndroidSupportSupportV42600Alpha1Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAds1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAdsLite1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesClearcut1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesGass1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesSafetynet1101Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTasks1101Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseAnalytics1101Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseAnalyticsImpl1101Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseCommon1101Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseCore1101Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseIid1101Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseMessaging1101Library UP-TO-DATE
:prepareMeLeolinShortcutBadger1117Library UP-TO-DATE
:prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:processDebugGoogleServices
Parsing json file: D:\Projects\Code\Hybrid Mobile App\DailySheet\platforms\android\google-services.json
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithJarMergingForDebug
:transformClassesWithMultidexlistForDebug
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug
BUILD SUCCESSFUL
Total time: 2 mins 48.709 secs
Built the following apk(s):
D:/Projects/Code/Hybrid Mobile App/DailySheet/platforms/android/build/outputs/apk/android-debug.apk
App is still taking 6-7 seconds to appear first screen. Iām sure it is not using AOT while production/release build.