AOT build fail on android


#1

i run

tns build android --bundle --env.uglify --env.aot --env.snapshot

get following error, no other information

ERROR in Cannot read property 'map' of undefined
Executing webpack failed with exit code 2.

Then i made some attempts

  1. tns run android --env.aot
    work
  2. tns run android --bundle --env.aot
    fail, same error msg
  3. tns run android --bundle --env.uglify
    work
  4. tns run android --env.uglify --env.aot
    work

It seems that the bundle option can affect aot building

tns info

nativescript 4.1.0
tns-core-module 4.1.0
tns-android 4.1.3

#2

I replace all arrays like xxx.map(…) with (xxx || []).map(…)
and all observables like xxx$.map(…) with xxx$.pipe(map(…)) (i use rxjs 6.6)
But the issue is still there.