找不到 com.android.support:multidex-instrumentation:27.1.1 [英] Could not find com.android.support:multidex-instrumentation:27.1.1

查看:52
本文介绍了找不到 com.android.support:multidex-instrumentation:27.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 https://developer.android.com/studio/build 上的说明进行操作/multidex

这是我的错误代码.任务:app:lintVitalRelease"执行失败.

Here is my error code. Execution failed for task ':app:lintVitalRelease'.

无法解析配置的所有工件
':app:debugAndroidTestRuntimeClasspath'.找不到 com.android.support:multidex-instrumentation:27.1.1.

Could not resolve all artifacts for configuration
':app:debugAndroidTestRuntimeClasspath'. Could not find com.android.support:multidex-instrumentation:27.1.1.

但是我在尝试获得签名的 apk 时遇到了同样的问题,这是我的依赖:

But i am geeting the same issue when trying the get signed apk here is the my dependicies:

defaultConfig {
    applicationId "com.myproject"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
    multiDexEnabled true
}

dependencies {
 implementation project(':react-native-date-picker')
 implementation project(':react-native-wheel-picker-android')
 implementation project(':lottie-react-native')
 implementation project(':react-native-firebase')
 implementation "com.google.firebase:firebase-auth:16.0.5"  
 implementation "com.google.android.gms:play-services-base:16.0.1"
 implementation "com.google.firebase:firebase-core:16.0.4"
 implementation 'com.android.support:multidex:1.0.3'
 implementation project(':react-native-svg')
 implementation fileTree(dir: "libs", include: ["*.jar"])
 implementation 'com.android.support:design:25.4.0'
 implementation "com.android.support:appcompat- 
 v7:${rootProject.ext.supportLibVersion}"
 implementation "com.facebook.react:react-native:+"  // From node_modules
 implementation project(':react-native-navigation')
 implementation project(':react-native-linear-gradient')

}

和我的 MainApplication.java:

and My MainApplication.java:

public class MainApplication extends NavigationApplication {

  @Override
  protected void attachBaseContext(Context base) {
     super.attachBaseContext(base);
     MultiDex.install(this);
  }


  @Override
      public boolean isDebug() {
      return BuildConfig.DEBUG;
  }

   protected List<ReactPackage> getPackages() {
      // Add additional packages you require here
      // No need to add RnnPackage and MainReactPackage
      return Arrays.<ReactPackage>asList(
        new LinearGradientPackage(),
        new LottiePackage(),
        new RNFirebasePackage(),
        new RNFirebaseAuthPackage(),
        new WheelPickerPackage(),
        new DatePickerPackage()
      );

  }

  @Override
  public List<ReactPackage> createAdditionalReactPackages() {
      return getPackages();
  }

  @Override
  public String getJSMainModuleName() {
    return "index";
  }
}

提前致谢

推荐答案

删除此行

@Override
  protected void attachBaseContext(Context base) {
     super.attachBaseContext(base);
     MultiDex.install(this);
  }

在 MainApplication.java

at MainApplication.java

 implementation 'com.android.support:multidex:1.0.3'

在 build.gradle

at build.gradle

并将 minSdkVersion 升级到 21 解决了我的问题

and upgradeting minSdkVersion to 21 solved my problem

这篇关于找不到 com.android.support:multidex-instrumentation:27.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆