question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run project on Android emulator

See original GitHub issue

Current Behavior

  • react-native run-android builds successfully.
  • haul start --platform android builds successfully.
  • Android emulator throws error. screen shot 2017-05-09 at 8 29 03 am

Expected Behavior

should run on android emulator.

Haul Configuration (webpack.haul.js)

var webpack = require('webpack');

module.exports = ({ platform }, defaults) => ({
  entry: `./index.${platform}.js`,
  module: {
    ...defaults.module,
    rules: [
      ...defaults.module.rules,
      {
        test: /\.(js|jsx)$/,
        loader: 'babel-loader',
        include: [
          /node_modules\/native-base-shoutem-theme/,
          /node_modules\/@shoutem/,
          /node_modules\/react-native-vector-icons/,
        ],
        query: {
          presets: ['react-native'],
        },
      },
      {
        test: /\.(otf|eot|svg|ttf|woff|woff2)$/,
        use: 'file-loader',
      },
    ],
  },
  resolve: {
    ...defaults.resolve,
    plugins: [
      ...defaults.resolve.plugins,
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify(process.env.NODE_ENV),
        },
      }),
    ],
  },
});

Environment

Software version
Haul master
react-native 0.44.0
node 7.7.2
npm 4.1.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
llainecommented, May 10, 2017

Did you ever tried to add es2015 in your preset ?

yard add -D babel-preset-es2015

I’m using Typescript but I have a similar issue.

const path = require('path');

module.exports = ({ platform }, { module, resolve }) => ({
  entry: `./src/index.${platform}.tsx`,
  module: {
    ...module,
    rules: [
      {
        test: /\.tsx?$/,
        use: [
            {
              loader: 'babel-loader',
              options: {
                presets: ['es2015']
              }
            },
            {
              loader: 'ts-loader'
            }
        ],
      },
      ...module.rules
    ]
  },
  resolve: {
    ...resolve,
    alias: {
        src: path.resolve(__dirname, 'src/'),
        components: path.resolve(__dirname, 'src/components/'),
        resources: path.resolve(__dirname, 'src/resources/')
    },
    extensions: ['.ts', '.tsx', `.${platform}.ts`, '.native.ts', `.${platform}.tsx`, '.native.tsx', ...resolve.extensions],
  },
});
0reactions
DomenicoColandrea86commented, May 11, 2017

BTW thanks for the quick responses and help @llaine @GeeWee

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot known issues with Android Emulator
If the emulator fails to launch due to the error vulkan-1.dll cannot be found , you probably need to update the emulator. To...
Read more >
Android studio: emulator is running but not showing up in ...
Solution- Open task manager and kill qemu-system (Under Android Studio). This will stop the emulator. Then restart emulator. Share.
Read more >
Cannot Run on an Android Device or Emulator
Power off or restart your Android device and then run your application again. · Choose another debug port: Select Run > Parameters and...
Read more >
[Solved] Android Studio Run Button not Working - YouTube
This Run Button usually used to test your apps in the android emulator. Since this button was greyed out and It's unclickable you...
Read more >
Android Studio — How to fix it
Update #1 ... There was a situation when I ran my app in Android Emulator, and I tried to attach debug, my application...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found