Import compose sample projects to android studio version 4.2
Asked Answered
O

3

7

I'm trying to import compose sample projects, but I'm facing this error:

Invalid injected android support version '202.7660.26.42.7322048', expected to be of the form 'w.x.y.z'

The android studio is currently updated to its newest version 4.2.

How can I fix this?

Obscurity answered 8/5, 2021 at 11:54 Comment(1)
Use Android Studio Arctic Fox | 2020.3.1 Canary 15. More info: developer.android.com/jetpack/compose/setupEure
E
11

The version 202.7660.26.42.7322048 is

Android Studio 4.2
Build #AI-202.7660.26.42.7322048, built on April 29, 2021

As suggested in the current (1.0.0-beta08) official setup of compose you should use the Android Studio in the beta channel:

Android Studio Arctic Fox | 2020.3.1 Beta 03
Eure answered 9/5, 2021 at 14:1 Comment(0)
S
6

Two methods to resolve this issue:

  1. Update Android Studio to canary channel 2021.1.1 Canary 1(AI-203.7717.56.2111.7361063) which includes the fix
  2. If you wish to remain in Android Studio stable channel Build #AI-202.7660.26.42.7351085, built on May 10, 2021 then you will need to

Open Project Structure dialog (Ctrl+Alt+Shift+S) and select Android Gradle plugin version to 4.2.1 ( >4.2.1 has this bug till version 7.1.0-alpha01) and Gradle version to 7.0.2.

enter image description here

Satiety answered 5/6, 2021 at 11:18 Comment(0)
R
0

Feature works fine on below version of Android studio.enter image description here

Robespierre answered 22/5, 2021 at 18:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.