原本使用Android Studio 版本是4.1.1,现更新为
点击build -》 build bundle -》build apk,项目报
Could not determine the dependencies of task ':app:compileDebugUnitTestJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugUnitTestCompileClasspath'.
> Could not find org.junit.jupiter:junit-jupiter:.
Required by:
project :app
根据错误提示,是编译时找不到项目依赖,解决办法修改build.gradle(Module)文件,修改repositories内容,
repositories {
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
}
下载手动在maven仓库https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter/5.5.1下载JUnit Jupiter (Aggregator) » 5.5.1 ,
将下载好的jar包放在libs目录下,并在build.gradle(:app)中修改dependencies,将jar添加进去
格式如:
implementation files('libs/文件名.格式')
我这里引入libs库的绝对路径,以后新放进去的jar包都不需要再在dependencies中添加了。文章来源:https://uudwc.com/A/y544o
implementation fileTree(dir: 'E:\\android_project\\XingGuPad\\app\\libs', include: ['*.aar', '*.jar'], exclude: [])
文章来源地址https://uudwc.com/A/y544o