大佬教程收集整理的这篇文章主要介绍了没有找到Android studio aar文件错误类,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
当我尝试在其他项目中使用导出的@L_618_0@库项目(aar格式)时.我收到以下错误.
> "Could not find class 'com.manish.core.Helper.RegistrationHelper$1'"
> "Could not find class 'com.manish.core.Helper.RegistrationHelper$2'"
> "Could not find class 'com.manish.core.Helper.RegistrationHelper$3'"
> "Could not find class 'com.manish.core.Helper.RegistrationHelper$4'"
在aar文件中有一个文件“classes.jar”,它包含所有类文件,但我不明白错误的原因.
我正在使用android studio在build目录中生成的aar文件.
我还在gradle文件中添加了apply plugin:’com.android.library’.
我的gradle文件:
apply plugin: 'com.manish.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.manish.test"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'],dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'junit:junit:4.12'
compile(name:'somerandomlibrary-debug',ext:'aar')
}
repositories{
flatDir{
dirs 'libs'
}
}
如果要使用flatDir repo导入aar文件,则还必须在项目中指定依赖项.你应该使用maven存储库!例如:maven-publish
一个更简单的解决方案是,将以下行添加到“aar”项目中的build.gradle:
task createPom {
apply plugin: 'maven'
description "Generates pom.xml"
pom {
project {
groupId 'com.example'
artifactId 'example'
version '0.0.1-SNAPSHOT'
packaging 'aar'
}
}.withXml {
def dependenciesnode = asnode().appendNode('dependencies')
configurations.compile.allDependencies.each { dependency ->
def dependencyNode = dependenciesnode.appendNode('dependency')
dependencyNode.appendNode('groupId',dependency.group)
dependencyNode.appendNode('artifactId',dependency.Name)
dependencyNode.appendNode('version',dependency.version)
}
}.writeTo("$buildDir/pom.xml")
}
以上是大佬教程为你收集整理的没有找到Android studio aar文件错误类全部内容,希望文章能够帮你解决没有找到Android studio aar文件错误类所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。