我包括:

compile 'com.ajts.androidmads.SQLite2Excel:library:1.0.2'


在我的应用程序级别gradle文件中。我已经同步了项目,它显示在应用程序的依赖项中:java - 无法从已编译的github库导入类-LMLPHP

但这不会让我从该库中导入类:

java - 无法从已编译的github库导入类-LMLPHP

我不确定自己在做什么错。以前从未使用过github。

这是项目gradle文件代码:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

    }
}

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


        maven { url "https://jitpack.io" }
    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}


和应用程序gradle代码:

apply plugin: 'com.android.application'

android {

    compileSdkVersion 24
    buildToolsVersion "26.0.2"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 4
        versionName "1.004"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        buildType {
        }
    }
}



dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-ads:11.2.0'
    compile 'com.ajts.androidmads.SQLite2Excel:library:1.0.2'
}


我真的很感激任何建议。

最佳答案

编辑您的代码:

SQLiteToExcel sqliteToExcel = new SQLiteToExcel(this, "helloworld.db");


您可以在代码顶部添加以下行:

import com.ajts.androidmads.library.SQLiteToExcel;

09-30 14:52
查看更多