I cloned Launcher3, which is the default launcher for AOSP: https://android.googlesource.com/platform/packages/apps/Launcher3/+/refs/tags/android-11.0.0_r28
I opened it on Android Studio and got
01:04 Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'Launcher3' platform 'android-R' not found. (1 m 34 s 191 ms)
What is wrong? I made sure Android 11 SDK is downloaded
You can not directly compile / add AOSP projects in Android Studio since they follow the AOSP build system. That said, you should try importing the sources using "idegen" tool at first.
Follow these for reference:
https://android.googlesource.com/platform/development/+/refs/heads/master/tools/idegen/README
While building using Android.mk /.bp is indeed better supported for AOSP projects, I believe you can fix the android-R
problem by setting COMPILE_SDK=30
in gradle.properties
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.