问题
I want to to add the androidx source code to my Android Studio project instead of using the provided library (implementation 'androidx.core:core-ktx:1.1.0'
). Using the provided library I can only view the source code (it's read only during debugging), but I need to modify it for testing purposes.
So how can I add the androidx source code to Android Studio so I can edit it?
回答1:
These repositories are usually being accessed with repo
-
but for the sake of simplicity, git
would also be supported:
git clone --branch androidx-master-dev https://android.googlesource.com/platform/frameworks/support /home/android/androidx-master-dev
Android Studio also supports git
; the repository URL to check out would be https://android.googlesource.com/platform/frameworks/support
and the branch is to select is eg. androidx-master-dev
;. However, manually adding the library modules you need might be better.
Only the pre-built artifacts have version numbers, not the source-code. And it might only be known internally, which commit equals which version number; it doesn't seem to be publicly documented. See Android CI and Android Code Search; it says nothing about any version numbers there either.
来源:https://stackoverflow.com/questions/60238922/add-androidx-source-code-to-android-studio-project-for-debugging