Android build APK breaking on config
See original GitHub issueI’m attempting to run ./gradlew assembleRelease in the android directory of my react-native app to build the APK. I expect the following code to replace my config files across the app however it’s not resolving properly.
webpack.haul.js
const path = require("path");
module.exports = ({ platform, root }, defaults) => ({
entry: `./index.${platform}.js`,
resolve: {
...defaults.resolve,
alias: {
...defaults.resolve.alias,
config: path.join(root, 'config')
}
}
});
App.js
import React from 'react';
import {Text, View} from 'react-native';
import config from 'config';
// more code below...
When I run I get the following error:
Unable to resolve module `config` from `/Users/brendan/Projects/<project-name>/App.js`: Module does not exist in the module map or in these directories:
/Users/brendan/Projects/<project-name>/node_modules
It seems to be working fine for the iOS build however for Android this issue is being thrown.
Your Environment
| software | version |
|---|---|
| Haul | ^1.0.0-beta.1 |
| react-native | ^0.44.0 |
| node | v8.0.0 |
| yarn | 0.21.3 |
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Android, Build Successful, but apk build (subsequent run) fails
I recently upgraded to Android studio 1.2 beta. Projects that compiled fine earlier, broke. I had to make some modifications in the gradle ......
Read more >Build and run your app - Android Developers
In the toolbar, select your app from the run configurations menu. ... You build the APK of your app using a debug build...
Read more >Create and edit run/debug configurations - Android Developers
Android Studio can create a run/debug configuration for some items displayed in the Project window. The configuration is based on a default template,...
Read more >Known issues with Android Studio and Android Gradle Plugin
Find out about current known issues with Android Studio and the Android Gradle ... navigate to Build > Generate Signed Bundle / APK...
Read more >Debug pre-built APKs - Android Developers
Known issue: When attaching debug symbols to an APK, both the APK and debuggable .so files must be built using the same workstation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had the same problem and solved it just by adding
project.ext.react = [ cliPath: "node_modules/haul/bin/cli.js" ]as it said in docs.I had the same problem and solved it just by adding:
// Haul project.ext.react = [ root: "../../", cliPath: "node_modules/haul/bin/cli.js" ]