react-native-builder-bob icon indicating copy to clipboard operation
react-native-builder-bob copied to clipboard

bob build not generated .aar file

Open iqfar12 opened this issue 3 years ago • 3 comments

Hello, i would like build my existing react native project to aar using bob builder, i already follow the documentation for manual installation by adding react-native-builder-bob script:

react-native-builder-bob": {
  "source": "src",
  "output": "lib",
  "targets": [
    ["aar", {"reverseJetify": true}],
    ["commonjs", {"copyFlow": true}],
    "module",
    "typescript",
  ]
}
"scripts": {
  "prepare": "bob build"
}
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.ts",
"types": "lib/typescript/index.d.ts",
"files": [
  "lib/",
  "src/"
]

and run

yarn bob build

and there's error

error: package com.facebook.react.bridge does not exist

and finally show up final error:

[Error: ENOENT: no such file or directory, copyfile 'android/build/outputs/aar/android.aar' -> '/Users/iqfar-infinitec/Desktop/qishe-mobile/lib/aar/android.aar'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'copyfile',
  path: 'android/build/outputs/aar/android.aar',
  dest: '/Users/iqfar-infinitec/Desktop/qishe-mobile/lib/aar/android.aar'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

but in my android/app/build/output show up release and debug apk file instead of aar file

here is my package.json:

{
  "name": "WIKA",
  "version": "0.0.1",
  "private": true,
  "main": "lib/commonjs/index.js",
  "module": "lib/module/index.js",
  "react-native": "src/index.js",
  "types": "lib/typescript/index.d.ts",
  "files": [
    "lib/",
    "src/"
  ],
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "prepare": "bob build"
  },
  "dependencies": {
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/async-storage": "^1.12.1",
    "@react-native-community/datetimepicker": "^3.0.9",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "axios": "^0.21.1",
    "d3": "^6.5.0",
    "moment": "^2.29.1",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-background-actions": "^2.6.0",
    "react-native-builder-bob": "^0.18.1",
    "react-native-calendars": "^1.1255.0",
    "react-native-camera": "^3.42.0",
    "react-native-chart-kit": "^6.11.0",
    "react-native-fs": "^2.16.6",
    "react-native-gesture-handler": "^1.9.0",
    "react-native-image-crop-picker": "^0.35.3",
    "react-native-photo-editor": "^1.0.10",
    "react-native-reanimated": "^1.13.2",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.17.1",
    "react-native-svg": "^12.1.0",
    "react-native-svg-charts": "^5.4.0",
    "react-native-swiper": "^1.6.0",
    "react-native-swiper-flatlist": "^3.0.14",
    "react-native-vector-icons": "^8.0.0",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "rn-fetch-blob": "^0.12.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-jest": "^25.1.0",
    "eslint": "^6.5.1",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native",
    "modulePathIgnorePatterns": ["<rootDir>/lib/"]
  },
  "react-native-builder-bob": {
    "source": "src",
    "output": "lib",
    "targets": [
      ["aar", {"reverseJetify": true}],
      ["commonjs", {"copyFlow": true}],
      "module",
      "typescript"
    ]
  }
}

did i miss something on configuration?

thank you

iqfar12 avatar May 24 '21 10:05 iqfar12

@matt-oakes any info about this ? im also facing this issue, i was expecting bob builder to generate my AAR file

kurroo10 avatar Oct 25 '21 22:10 kurroo10

Any updates regarding this? I also encountered this one. thanks!

maurusrv avatar Dec 20 '21 07:12 maurusrv

Any info about this? I am facing the same issue, additionally I have react-native-web in my dependencies. Any help would be greatly appreciated!

yakuphanbilgic avatar Jun 28 '22 11:06 yakuphanbilgic

try to change options in package.json:

"react-native-builder-bob": {
    "source": "src",
    "output": "lib",
    "targets": [
      "commonjs",
      "module",
      // "aar" <- REPLACE THIS ...
      ["aar", { "androidBundleName":  "android-release.aar" }] // <- ... BY THIS ...
      // OR WHATEVER .aar GENERATED FILE YOU FIND IN: android/build/outputs/aar
    ]
  },

ubugnu avatar Feb 16 '23 15:02 ubugnu