這個問題,我更新我的Android工作室2.0之後發生的,當我嘗試運行我得到這個:錯誤:警告:忽略InnerClasses屬性爲一個匿名內部類錯誤:(org.jsonschema2pojo.gradle)
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(org.jsonschema2pojo.gradle.GenerateJsonSchemaTask$_configureAndroid_closure4) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is not an inner class.
這是我的build.gradle(Modeule:app)
有人可以向我解釋如何解決這個問題。
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
//apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "tazligen.com.tazligen"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'NOTICE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txtd'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/NOTICE.txt'
}
productFlavors {
}
}
ext {
supportLibVersion = "23.2.1"
googlePlayServicesVersion = "8.4.0"
junitVersion = "4.12"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile "junit:junit:${junitVersion}"
// Android Support Library
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile "com.android.support:support-v4:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
// Networking libraries
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.6.2'
compile 'org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:0.4.16'
compile 'javax.annotation:jsr250-api:1.0'
compile 'org.apache.httpcomponents:httpmime:4.3.1'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'io.realm:realm-android:0.84.1'
compile 'info.hoang8f:android-segmented:1.0.6'
compile 'com.github.blackfizz:eazegraph:[email protected]'
compile 'com.nineoldandroids:library:2.4.0'
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
}
我有同樣的問題。請按照下列步驟操作: 1-關閉Android Studio並重新打開它 2 -Re構建您的項目 這對我有用。我希望這項工作也給你 –
我很確定我試過,然後我試着解決方案,我只是給了它,奇怪的是它的工作,反正謝謝:) –