Я пытаюсь установить ORMlite в свой проект Android Studio, но я не могу получить файл R.raw.ormlite_config, я нашел это: https://github.com/stephanenicolas/ormlite-android-gradle-plugin, но все еще не работает ...Не удается найти файл конфигурации ormlite
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.stephanenicolas.ormgap:ormgap-plugin:1.0.12'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
apply plugin: 'ormgap'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "..."
minSdkVersion 16
targetSdkVersion 23
versionCode 12
versionName "1.2.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.j256.ormlite:ormlite-android:5.0'
compile files('libs/ksoap2-android-assembly-3.6.1-jar-with-dependencies.jar')
}
Для моего DataHelper:
public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
private static final int DATABASE_VERSION = 4;
private static final String DATABASE_NAME = "solutis.db";
private Dao<Demandes, Integer> simpleDao = null;
private RuntimeExceptionDao<Demandes, Integer> simpleRuntimeDao = null;
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION, android.R.raw.ormlite_config);
}
@Override
public void onCreate(SQLiteDatabase db, ConnectionSource connectionSource){
}
@Override
public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {
}
}
Я создал такой файл, посмотрите здесь: http://stackoverflow.com/questions/17298773/android-studio-run-configuration-for-ormlite-config-generation Но он тоже не работает – Ben
Пожалуйста, следуйте инструкциям как указано в документации. Я еще не пробовал, но взволнован, чтобы попробовать этот плагин. Кроме того, поделитесь тем, с чем вы столкнулись сейчас. Я постараюсь решить. –
Это было трудно понять, как сгенерировать файл, но я нашел его здесь: http://stackoverflow.com/questions/31199875/compilation-of-ormliteconfig-file-in-android-studio – Ben