-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Error on running Couldn't find "Debug" build variant. #36561
Comments
I can't reproduce your issue. can you try again with:
|
This could also be CLI related 🤔 |
The same problem occurs |
still stuck here |
please try with 0.72 RC2, we just released it and contains a bunch of improvements for CLI |
This is definitely CLI related. @thymikee can we get someone to look into this? |
@pipo151086 can you run |
@thymikee |
Hey, since this issue was fixed last week in react-native-community/cli#1933 - we can close this issue. cc. @cortinico |
Not yet.... just about an hour ago they released the new version (11.3.0) that contains the fix of the whitespaces.... react-native-community/cli@v11.2.3...v11.3.0 please update the inner dependecy of cli from 11.2.3 to 11.3.0 |
I'm closing this as it's effectively fixed on our end. We're going to bump the CLI and you'll get the fix automatically. Please comment further if the issue is unsolved. |
@cortinico I updated react-native-community/cli and I keep getting this error |
Use this patch: @react-native-community+cli-platform-android+11.2.3.patch diff --git a/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/listAndroidTasks.js b/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/listAndroidTasks.js
index 59fe1e2..89a0e54 100644
--- a/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/listAndroidTasks.js
+++ b/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/listAndroidTasks.js
@@ -37,7 +37,7 @@ const parseTasksFromGradleFile = (taskType, text) => {
const instalTasks = [];
const taskRegex = new RegExp(taskType === 'build' ? '^assemble|^bundle' : '^install');
text.split('\n').forEach(line => {
- if (taskRegex.test(line) && /(?!.*?Test)^.*$/.test(line)) {
+ if (taskRegex.test(line.trim()) && /(?!.*?Test)^.*$/.test(line.trim())) {
const metadata = line.split(' - ');
instalTasks.push({
task: metadata[0], |
@mordechaim can you submit that as a PR to the CLI repo? or is a fix on their end already out? |
@kelset The fix is already merged in CLI, and it is released in v11.3.0 |
i upgrade from 0.70.6 to 0.72.3, and the eact-native-community/cli version is 11.3.5, when run: yarn android, the error occur:
|
I add this code in build.gradle Is it related to find build variant? |
@cortinico this issue still persists on my end. I am working on a mac m1, maybe that makes a difference for some reason? I tested the fix locally, my gradlew build is a success, but the new regex is not resulting in |
@lauhon please open new issue in https://github.com/react-native-community/cli and provide your setup. |
New Version
0.72.0-rc.0
Old Version
0.71.3
Build Target(s)
Android
Output of
react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-4770S CPU @ 3.10GHz
Memory: 1.49 GB / 11.91 GB
Binaries:
Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.6.2 - C:\Program Files\nodejs\npm.CMD
Watchman: 20210110.135312.0 - C:\ProgramData\chocolatey\bin\watchman.EXE
Managers:
RubyGems: Not Found
SDKs:
Android SDK:
API Levels: 23, 26, 28, 29, 30, 31, 33
Build Tools: 28.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.1, 33.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google
APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-33 | Google APIs Intel x86 Atom_64, android-33 | Google Play Intel x86 Atom_64
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-221.6008.13.2211.9619390
Visual Studio: 17.5.33424.131 (Visual Studio Professional 2022)
Languages:
Java: 11.0.2 - C:\Users\Miguel.Altamirano\AppData\Local\jdk-11.0.2\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.72.0-rc.0 => 0.72.0-rc.0
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Issue and Reproduction Steps
just create a new project
react-native init AwesomeProject --version 0.72.0-rc.0
cd AwesomeProject
npx react-native run-android
RESULT>>>>>>>
error Failed to install the app. Couldn't find "Debug" build variant. Available variants are: .
info Run CLI with --verbose flag for more details.
The text was updated successfully, but these errors were encountered: