匹配 Android Studio 在旧的 Android 项目中的版本

huangapple go评论79阅读模式
英文:

Matching version for android studio in old android projects

问题

Android项目实际上高度依赖Gradle版本。因此,许多项目都附带了所需Gradle版本的包装器 gradlew

众所周知,Android Studio需要一个最低Gradle版本来运行项目。这导致许多项目无法使用。

这是一个示例:https://github.com/google/grafika

在连接的设备上构建和安装正常工作:

git clone https://github.com/google/grafika
cd grafika
chmod +x gradlew
./gradlew build
./gradlew installDebug

但在Android Studio中打开它会要求重新生成包装器,然后一切都会出现问题。甚至由于构建问题,代码导航也出现问题。

是否有支持项目所需版本的Android Studio版本的列表?

如果附带的Gradle版本是3.3,应该使用哪个匹配的Android Studio?

英文:

Android projects are really dependant on gradle version. Due to it, many of them comes with a wrapper for the working version of gradle they need, gradlew.

Android studio is known to need a minimal gradle version to run a project. that makes many projects unusable.

This is an example: https://github.com/google/grafika

build and install on connected device just works:

git clone https://github.com/google/grafika
cd grafika
chmod +x gradlew
./gradlew build
./gradlew installDebug

But open in android studio it ask to regenerate the wrapper and then everything breaks. Even code navigation is broke due to problems to build.

Is there any list with version of Android Studio supporting needed version for a project?

In case attached gradle needed is 3.3, what would be the matching android studio to use?

答案1

得分: 1

你应该关注Android Gradle插件(AGP)版本。
Android Studio和AGP版本兼容性列表在这里:https://developer.android.com/studio/releases/gradle-plugin#android_gradle_plugin_and_android_studio_compatibility

如果Gradle版本是3.3,那意味着AGP版本是2.x。现代版本的Android Studio不支持它,你需要一些非常古老的版本。

英文:

You should focus on Android Gradle Plugin (AGP) version.
The list of Android studio and AGP versions compatibility is here:
https://developer.android.com/studio/releases/gradle-plugin#android_gradle_plugin_and_android_studio_compatibility

If the gradle version is 3.3 it means that the AGP version is something 2.x. Modern versions of Android Studio don't support it, you need something really ancient.

huangapple
  • 本文由 发表于 2023年3月7日 01:09:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75653801.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定