【问题标题】:Android Studio 3.1.3 . Build Error while Executing app on build apk or emulator安卓工作室 3.1.3 。在构建 apk 或模拟器上执行应用程序时构建错误
【发布时间】:2022-09-30 16:07:04
【问题描述】:

我已经将我的 windows 7 Ultimate 升级到 windows 8.1,打开我的项目后,我尝试运行 build apk 并尝试在模拟器上运行它,它显示了这个错误。可能是升级过程中删除了某些文件,但我找不到发生了什么。 这是我的 build.gradle(模块应用程序)文件:

apply plugin: \'com.android.application\'

android 
{
  compileSdkVersion 32
  defaultConfig 
    {
     applicationId \"com.shoppings.thetrade.e_shop\"

     minSdkVersion 17
     targetSdkVersion 32
     versionCode 1
     versionName \"1.0\"
     testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"
    }
    buildTypes {
      release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile(\'proguard-android.txt\'), \'proguard-rules.pro\'
      }

    }
}

dependencies {
  implementation fileTree(dir: \'libs\', include: [\'*.jar\'])
  implementation \'com.android.support:appcompat-v7:26.+\'
  implementation \'com.android.support.constraint:constraint-layout:1.0.2\'
  implementation \'com.google.firebase:firebase-core:16.0.1\'
  implementation \'com.github.rey5137:material:1.2.5\'
  implementation \'com.android.support:cardview-v7:26.1.0\'
  implementation \'com.google.firebase:firebase-database:16.0.1\'
  implementation \'io.github.pilgr:paperdb:2.7.2\'
  testImplementation \'junit:junit:4.12\'
  androidTestImplementation \'com.android.support.test:runner:1.0.1\'
  androidTestImplementation \'com.android.support.test.espresso:espresso-core:3.0.1\'
  implementation \'com.android.support:recyclerview-v7:26.+\'
}
apply plugin: \'com.google.gms.google-services\'

这是在模拟器上运行应用程序期间在运行任务中显示的第一个错误:

这是第二个错误:

    标签: android build.gradle


    【解决方案1】:

    我有非常相似的问题,解决方案是添加这些行 在 gradle.properties 中:

    android.useAndroidX=true
    android.enableJetifier=true
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-06-19
      • 1970-01-01
      • 2018-11-05
      • 1970-01-01
      • 2021-08-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多