Fresh project does not work on Android with a Mac M1
See original GitHub issueDescription
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.
- npx react-native init AwesomeTSProject
- 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:
- Created 2 years ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
@cortinico Seems to be a particular issue happening in my machine, you can close it, thanks
@Rolando-Barbella Has this issue resolved? Are we good to close it?