Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildflavour errors not able to run android app in MAC #48134

Closed
bindund opened this issue Dec 6, 2024 · 5 comments
Closed

Buildflavour errors not able to run android app in MAC #48134

bindund opened this issue Dec 6, 2024 · 5 comments
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: Android Android applications. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed.

Comments

@bindund
Copy link

bindund commented Dec 6, 2024

Description

info React Native v0.76.3 is now available (your project is running on v0.74.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.3
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
info Dev server ready

i - run on iOS
a - run on Android
d - open Dev Menu
r - reload app

info Opening app on Android...
info A dev server is already running for this project on port 8081.
info Installing the app...
Starting a Gradle Daemon, 1 busy and 2 stopped Daemons could not be reused, use --status for details

Task :gradle-plugin:checkKotlinGradlePluginConfigurationErrors
Task :gradle-plugin:compileKotlin UP-TO-DATE
Task :gradle-plugin:compileJava NO-SOURCE
Task :gradle-plugin:pluginDescriptors UP-TO-DATE
Task :gradle-plugin:processResources UP-TO-DATE
Task :gradle-plugin:classes UP-TO-DATE
Task :gradle-plugin:jar UP-TO-DATE

Configure project :app
Reading env from: .env

Configure project :react-native-reanimated
Android gradle plugin: 8.2.1
Gradle: 8.6

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
5 actionable tasks: 1 executed, 4 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    Cannot locate tasks that match 'app:installDebug' as task 'installDebug' is ambiguous in project ':app'. Candidates are: 'installDevelopmentDebug', 'installDevelopmentDebugAndroidTest', 'installProductionDebug', 'installProductionDebugAndroidTest'.

  • Try:

Run gradlew tasks to get a list of available tasks.
For more on name expansion, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:name_abbreviation in the Gradle documentation.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 14s
info Run CLI with --verbose flag for more details.

Steps to reproduce

racit@RACs-MacBook-Pro-2 app-facility-manager % yarn android
Internal Error: appFacilityManager@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
at V0.getCandidates (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:435:5145)
at kf.getCandidates (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:391:1264)
at /Users/racit/.yarn/releases/yarn-3.6.4.cjs:439:8033
at df (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:390:11070)
at ge (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:439:8013)
at async Promise.allSettled (index 0)
at async io (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:390:10398)
at async /Users/racit/.yarn/releases/yarn-3.6.4.cjs:439:8545
at async ti.startProgressPromise (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:390:47651)
at async je.resolveEverything (/Users/racit/.yarn/releases/yarn-3.6.4.cjs:439:6573)
racit@RACs-MacBook-Pro-2 app-facility-manager %

React Native Version

0.74.3

Affected Platforms

Runtime - Android, Build - MacOS

Output of npx react-native info

racit@RACs-MacBook-Pro-2 app-facility-manager % npx react-native info
info Fetching system and libraries information...
System:
  OS: macOS 15.0.1
  CPU: (12) arm64 Apple M3 Pro
  Memory: 651.45 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.5
    path: ~/.nvm/versions/node/v18.20.5/bin/node
  Yarn:
    version: 3.6.4
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.0
    path: ~/Desktop/app-facility-manager/node_modules/.bin/npm
  Watchman:
    version: 2024.11.18.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/racit/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12550806
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 3.1.2
    path: /Users/racit/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

info React Native v0.76.3 is now available (your project is running on v0.74.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.3
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
racit@RACs-MacBook-Pro-2 app-facility-manager %

Stacktrace or Logs

package com.nhance.facilitymanager;
// import com.brentvatne.react.ReactVideoPackage;
import com.reactnativecompressor.CompressorPackage;
// import org.wonday.orientation.OrientationActivityLifecycle;
// import com.rumax.reactnative.pdfviewer.PDFViewPackage;
import android.app.Application;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import java.util.List;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
// import com.zoontek.rnpermissions.RNPermissionsPackage;
// import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
// import io.invertase.firebase.app.ReactNativeFirebaseAppPackage;
// import com.google.firebase.messaging.FirebaseMessaging;

// import com.rumax.reactnative.pdfviewer.PDFViewPackage;
// import com.tectiv3.aes.RCTAesPackage;
// import com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost =
      new DefaultReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWarnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // packages.add(new MyReactNativePackage());
          return packages;
        }

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }

        @Override
        protected boolean isNewArchEnabled() {
          return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
        }

        @Override
        protected Boolean isHermesEnabled() {
          return BuildConfig.IS_HERMES_ENABLED;
        }
      };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
      // If you opted-in for the New Architecture, we load the native entry point for this app.
      DefaultNewArchitectureEntryPoint.load();
    }
    //  FirebaseMessaging.getInstance().setDeliveryMetricsExportToBigQuery(true);
    // ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
    // registerActivityLifecycleCallbacks(OrientationActivityLifecycle.getInstance());
  }
}

Reproducer

facility App

Screenshots and Videos

racit@RACs-MacBook-Pro-2 app-facility-manager % npm start

[email protected] start
react-native start

info Welcome to React Native v0.74
info Starting dev server on port 8081...

                    ▒▒▓▓▓▓▒▒
                 ▒▓▓▓▒▒░░▒▒▓▓▓▒
              ▒▓▓▓▓░░░▒▒▒▒░░░▓▓▓▓▒
             ▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓
             ▓▓░░░░░▒▓▓▓▓▓▓▒░░░░░▓▓
             ▓▓░░▓▓▒░░░▒▒░░░▒▓▒░░▓▓
             ▓▓░░▓▓▓▓▓▒▒▒▒▓▓▓▓▒░░▓▓
             ▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓▓
             ▓▓▒░░▒▒▓▓▓▓▓▓▓▓▒░░░▒▓▓
              ▒▓▓▓▒░░░▒▓▓▒░░░▒▓▓▓▒
                 ▒▓▓▓▒░░░░▒▓▓▓▒
                    ▒▒▓▓▓▓▒▒


            Welcome to Metro v0.80.12
          Fast - Scalable - Integrated

info React Native v0.76.3 is now available (your project is running on v0.74.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.3
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
info Dev server ready

i - run on iOS
a - run on Android
d - open Dev Menu
r - reload app

info Opening app on Android...
info A dev server is already running for this project on port 8081.
info Installing the app...

Task :gradle-plugin:checkKotlinGradlePluginConfigurationErrors
Task :gradle-plugin:compileKotlin UP-TO-DATE
Task :gradle-plugin:compileJava NO-SOURCE
Task :gradle-plugin:pluginDescriptors UP-TO-DATE
Task :gradle-plugin:processResources UP-TO-DATE
Task :gradle-plugin:classes UP-TO-DATE
Task :gradle-plugin:jar UP-TO-DATE

Configure project :app
Reading env from: .env

Configure project :react-native-reanimated
Android gradle plugin: 8.2.1
Gradle: 8.6

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
5 actionable tasks: 1 executed, 4 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    Cannot locate tasks that match 'app:installDebug' as task 'installDebug' is ambiguous in project ':app'. Candidates are: 'installDevelopmentDebug', 'installDevelopmentDebugAndroidTest', 'installProductionDebug', 'installProductionDebugAndroidTest'.

  • Try:

Run gradlew tasks to get a list of available tasks.
For more on name expansion, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:name_abbreviation in the Gradle documentation.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 4s
info Run CLI with --verbose flag for more details.

@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added Newer Patch Available Platform: Android Android applications. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Dec 6, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@cortinico cortinico added the Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed. label Dec 6, 2024
@react-native-bot
Copy link
Collaborator

Caution

Invalid issue: This issue is not valid, either is not a bug in React Native, it doesn't match any of the issue template, or we can't help further with this.

@cortinico
Copy link
Contributor

Please describe what is your problem and don't just dump your console here in the body of the bug report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: Android Android applications. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed.
Projects
None yet
Development

No branches or pull requests

3 participants