LiquidPlayer / LiquidCore

Node.js virtual machine for Android and iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android build fails after including AWS Amplify node module

JaspreetDev opened this issue · comments

OS: Linux Mint 20
LiquidCore: 0.7.10
Android Studio: 4.1.1
Android API: 30

I've successfully tested LiquidCore without adding any major node modules. Everything works fine till I require aws-amplify module. When I try to build the app on Android Studio, the build fails with the following,

> Task :app:bundleLiquidCoreCode
                                                          
               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               
                                                          
                  Welcome to React Native!
                 Learn once, write anywhere


WARN: Cannot resolve module './zlib_bindings'.  This will throw an Error at runtime.
{ SyntaxError: /home/antisaby/Projects/Android/LiquidTest/node_modules/react-native/index.js: Unexpected token, expected "{" (13:7)

  11 | 'use strict';
  12 | 
> 13 | import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
     |        ^
  14 | import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
  15 | import typeof Button from './Libraries/Components/Button';
  16 | import typeof CheckBox from './Libraries/Components/CheckBox/CheckBox';
    at Parser._raise (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:748:17)
    at Parser.raiseWithData (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:741:17)
    at Parser.raise (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:735:17)
    at Parser.unexpected (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:9097:16)
    at Parser.expect (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:9083:28)
    at Parser.parseNamedImportSpecifiers (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:13233:10)
    at Parser.parseImport (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:13078:39)
    at Parser.parseStatementContent (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:11750:27)
    at Parser.parseStatement (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:11650:17)
    at Parser.parseBlockOrModuleBlockBody (/home/antisaby/Projects/Android/LiquidTest/node_modules/@babel/parser/lib/index.js:12232:25)
  type: 'TransformError',
  snippet: undefined,
  lineNumber: 13,
  column: 7,
  filename: 'node_modules/react-native/index.js' }

> Task :app:bundleLiquidCoreCode FAILED

Execution failed for task ':app:bundleLiquidCoreCode'.
> Process 'command 'node'' finished with non-zero exit value 254

I have tried disabling/enabling minify in package.json but no success.

@ericwlange Thank you for getting back to me. The same setup works just fine if I exclude the aws-amplify require and the packager picks up the import statements just fine.