"Could not parse Android Application Module's Gradle config" in Android Studio? error

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

"Could not parse Android Application Module's Gradle config" in Android Studio? error

问题

I am developing jetpack compose android application using firebase but when I run project I am getting following exception

Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync
I followed this answer link but it did not solve my problem

below my app.gradle file

  1. plugins {
  2. id 'com.android.application'
  3. id 'org.jetbrains.kotlin.android'
  4. id 'kotlin-kapt'
  5. id 'com.google.gms.google-services'
  6. }
  7. android {
  8. compileSdk 33
  9. defaultConfig {
  10. applicationId "com.example.firebasegooglesignjetpackcompose"
  11. minSdk 24
  12. targetSdk 33
  13. versionCode 1
  14. versionName "1.0"
  15. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  16. vectorDrawables {
  17. useSupportLibrary true
  18. }
  19. }
  20. buildTypes {
  21. release {
  22. minifyEnabled false
  23. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  24. }
  25. }
  26. compileOptions {
  27. sourceCompatibility JavaVersion.VERSION_1_8
  28. targetCompatibility JavaVersion.VERSION_1_8
  29. }
  30. kotlinOptions {
  31. jvmTarget = '1.8'
  32. }
  33. buildFeatures {
  34. compose true
  35. }
  36. composeOptions {
  37. kotlinCompilerExtensionVersion '1.4.3'
  38. }
  39. packagingOptions {
  40. resources {
  41. excludes += '/META-INF/{AL2.0,LGPL2.1}'
  42. }
  43. }
  44. buildToolsVersion '33.0.0'
  45. ndkVersion '33.0.0'
  46. }
  47. dependencies {
  48. implementation 'androidx.core:core-ktx:1.7.0'
  49. implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
  50. implementation 'androidx.activity:activity-compose:1.3.1'
  51. implementation "androidx.compose.ui:ui:$compose_ui_version"
  52. implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
  53. implementation 'androidx.compose.material:material:1.2.0'
  54. testImplementation 'junit:junit:4.13.2'
  55. androidTestImplementation 'androidx.test.ext:junit:1.1.5'
  56. androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
  57. androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
  58. debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
  59. debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
  60. implementation platform('com.google.firebase:firebase-bom:31.5.0')
  61. implementation 'com.google.firebase:firebase-auth-ktx:21.3.0'
  62. implementation 'com.google.android.gms:play-services-auth:20.5.0'
  63. implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0"
  64. implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.0"
  65. implementation "androidx.navigation:navigation-compose:2.5.3"
  66. implementation "io.coil-kt:coil-compose:2.2.2"
  67. }
  68. below build.gradle
  69. buildscript {
  70. ext {
  71. compose_ui_version = '1.4.0'
  72. }
  73. dependencies {
  74. classpath 'com.google.gms:google-services:4.3.15'
  75. }
  76. }
  77. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  78. plugins {
  79. id 'com.android.application' version '7.2.1' apply false
  80. id 'com.android.library' version '7.2.1' apply false
  81. id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
  82. id 'com.google.gms.google-services' version '4.3.15' apply false
  83. }
  84. task clean(type: Delete) {
  85. delete rootProject.buildDir
  86. }
  87. I want to know where I am making mistake I am using android studio bumbble version
  88. <details>
  89. <summary>英文:</summary>
  90. I am developing jetpack compose android application using firebase but when I run project I am getting following exception
  91. Could not parse the Android Application Module&#39;s Gradle config. Resolve gradle build issues and/or resync
  92. I followed this answer https://stackoverflow.com/questions/70883309/android-studios-project-gradle-file-changed but it did not solve my problem
  93. below my app.gradle file
  94. plugins {
  95. id &#39;com.android.application&#39;
  96. id &#39;org.jetbrains.kotlin.android&#39;
  97. id &#39;kotlin-kapt&#39;
  98. id &#39;com.google.gms.google-services&#39;
  99. }
  100. android {
  101. compileSdk 33
  102. defaultConfig {
  103. applicationId &quot;com.example.firebasegooglesignjetpackcompose&quot;
  104. minSdk 24
  105. targetSdk 33
  106. versionCode 1
  107. versionName &quot;1.0&quot;
  108. testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
  109. vectorDrawables {
  110. useSupportLibrary true
  111. }
  112. }
  113. buildTypes {
  114. release {
  115. minifyEnabled false
  116. proguardFiles getDefaultProguardFile(&#39;proguard-android-optimize.txt&#39;), &#39;proguard-rules.pro&#39;
  117. }
  118. }
  119. compileOptions {
  120. sourceCompatibility JavaVersion.VERSION_1_8
  121. targetCompatibility JavaVersion.VERSION_1_8
  122. }
  123. kotlinOptions {
  124. jvmTarget = &#39;1.8&#39;
  125. }
  126. buildFeatures {
  127. compose true
  128. }
  129. composeOptions {
  130. kotlinCompilerExtensionVersion &#39;1.4.3&#39;
  131. }
  132. packagingOptions {
  133. resources {
  134. excludes += &#39;/META-INF/{AL2.0,LGPL2.1}&#39;
  135. }
  136. }
  137. buildToolsVersion &#39;33.0.0&#39;
  138. ndkVersion &#39;33.0.0&#39;
  139. }
  140. dependencies {
  141. implementation &#39;androidx.core:core-ktx:1.7.0&#39;
  142. implementation &#39;androidx.lifecycle:lifecycle-runtime-ktx:2.3.1&#39;
  143. implementation &#39;androidx.activity:activity-compose:1.3.1&#39;
  144. implementation &quot;androidx.compose.ui:ui:$compose_ui_version&quot;
  145. implementation &quot;androidx.compose.ui:ui-tooling-preview:$compose_ui_version&quot;
  146. implementation &#39;androidx.compose.material:material:1.2.0&#39;
  147. testImplementation &#39;junit:junit:4.13.2&#39;
  148. androidTestImplementation &#39;androidx.test.ext:junit:1.1.5&#39;
  149. androidTestImplementation &#39;androidx.test.espresso:espresso-core:3.5.1&#39;
  150. androidTestImplementation &quot;androidx.compose.ui:ui-test-junit4:$compose_ui_version&quot;
  151. debugImplementation &quot;androidx.compose.ui:ui-tooling:$compose_ui_version&quot;
  152. debugImplementation &quot;androidx.compose.ui:ui-test-manifest:$compose_ui_version&quot;
  153. implementation platform(&#39;com.google.firebase:firebase-bom:31.5.0&#39;)
  154. implementation &#39;com.google.firebase:firebase-auth-ktx:21.3.0&#39;
  155. implementation &#39;com.google.android.gms:play-services-auth:20.5.0&#39;
  156. implementation &quot;androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0&quot;
  157. implementation &quot;androidx.lifecycle:lifecycle-runtime-compose:2.6.0&quot;
  158. implementation &quot;androidx.navigation:navigation-compose:2.5.3&quot;
  159. implementation &quot;io.coil-kt:coil-compose:2.2.2&quot;
  160. }
  161. below build.gradle
  162. buildscript {
  163. ext {
  164. compose_ui_version = &#39;1.4.0&#39;
  165. }
  166. dependencies {
  167. classpath &#39;com.google.gms:google-services:4.3.15&#39;
  168. }
  169. }// Top-level build file where you can add configuration options common to all sub-projects/modules.
  170. plugins {
  171. id &#39;com.android.application&#39; version &#39;7.2.1&#39; apply false
  172. id &#39;com.android.library&#39; version &#39;7.2.1&#39; apply false
  173. id &#39;org.jetbrains.kotlin.android&#39; version &#39;1.8.10&#39; apply false
  174. id &#39;com.google.gms.google-services&#39; version &#39;4.3.15&#39; apply false
  175. }
  176. task clean(type: Delete) {
  177. delete rootProject.buildDir
  178. }
  179. I want to know where I am making mistake I am using android studio bumbble version
  180. </details>
  181. # 答案1
  182. **得分**: 0
  183. 我通过将Android Studio版本从Bumble版本升级到Flamingo版本来解决了问题。
  184. <details>
  185. <summary>英文:</summary>
  186. I fixed issue by updating android studio version from bumbble version to flamingo
  187. </details>

huangapple
  • 本文由 发表于 2023年4月17日 17:35:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76033687.html
匿名

发表评论

匿名网友

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

确定