android studio项目中的非法转发参考

时间:2019-02-16 03:02:06

标签: java android android-studio

这是一个旧的Eclipse项目,现在正在迁移到Android Studio。我在一个特定的班级遇到一个error: illegal forward reference错误。实际上,它在Android Studio IDE建议的错误行上没有显示任何红色错误指示行。奇怪的是,我试图注释掉显示非法前向引用错误的方法,但是即使在注释后,Android Studio仍将我指向先前显示为错误的相同行号。

我不知道这是Java编译器错误还是Android Studio IDE错误。

app / build.gradle

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.karogevideos"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
useLibrary 'org.apache.http.legacy'

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'biz.source_code:base64coder:2010-12-19'
    implementation files('libs/libGoogleAnalyticsServices.jar')
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'commons-httpclient:commons-httpclient:3.1'
    implementation 'commons-io:commons-io:2.6'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation files('libs/bugsense-trace-3.0.6.jar')
    //implementation files('libs/jid3lib-0.5.1.jar')
    implementation 'org.apache.httpcomponents:httpmime:4.5.2'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
    implementation group: 'com.nineoldandroids', name: 'library', version: '2.4.0'
    implementation group: 'commons-net', name: 'commons-net', version: '3.5'
  }

project / build.gradle

buildscript {
repositories {
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://maven.google.com" }

    }
}

让我知道您是否需要更多评论细节,谢谢。

1 个答案:

答案 0 :(得分:0)

将此namespace :db do desc "Erase all tables" task :clear => :environment do conn = ActiveRecord::Base.connection tables = conn.tables tables.each do |table| puts "Deleting #{table}" conn.drop_table(table, force: :cascade) end end end jar文件放在您的lib文件夹中。 Gradle在您的lib文件夹位置中找不到此文件。