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.

Fresh project does not work on Android with a Mac M1

See original GitHub issue

Description

I have a Mac m1, trying to get a fresh project running but no luck, the error message I’m getting is the following:

* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified. Please add it to build.gradle

I read the guide on M1 for IOS, but don’t see much info regarding android and M1

React Native version:

Run react-native info in your terminal and copy the results here.

System: OS: macOS 11.2.3 CPU: (8) x64 Apple M1 Memory: 62.37 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 12.13.1 - /usr/local/bin/node Yarn: 1.22.10 - /opt/homebrew/bin/yarn npm: 7.10.0 - /usr/local/bin/npm Watchman: 4.9.0 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.3, 31.0.0 System Images: android-25 | Google APIs ARM EABI v7a, android-30 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.7199119 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild Languages: Java: javac 17 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.2 => 0.64.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. npx react-native init AwesomeTSProject
  2. npx react-native run-android

Expected Results

Successfully build the app for android

Snack, code example, screenshot, or link to a repository:

I tried doing some of the following in the app/build.gradle file but not a lot of luck

android {
    ndkVersion rootProject.ext.ndkVersion

    compileSdkVersion 29
    ....

or

defaultConfig {
       ....
      compileSdkVersion rootProject.ext.compileSdkVersion
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rolando-Barbellacommented, Jan 10, 2022

@cortinico Seems to be a particular issue happening in my machine, you can close it, thanks

0reactions
cortinicocommented, Jan 10, 2022

@Rolando-Barbella Has this issue resolved? Are we good to close it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native CLI project does not work on Android with a Mac ...
I have a Mac m1 Max, trying to get a fresh project running,it is runing IOS without problem, but no luck on android,...
Read more >
Flutter Doctor not working on fresh install in my Mac Air M1 chip
Problem solve. You can see solution here: ... Open the file $HOME/.zshrc $HOME is your home path ... The process is also documented...
Read more >
Emulate Android apps on M1/M2 Mac WITHOUT Bluestacks ...
PlayCover sideloading tutorial for M1 Mac : https://www.youtube.com/watch?v=AXg59NS84nYTHE REAL REASON why iOS games don't come to M1 Mac : ...
Read more >
Troubleshoot known issues with Android Emulator
To avoid this problem, disable the microphone in the emulator by adding hw.audioInput=no to the config.ini file of the Android Virtual Device ( ......
Read more >
Apple M1 Processor Overview and Compatibility - Toptal
How serious are these problems? For the time being, some crucial tools either won't run on new Macs or won't run properly. These...
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