Following notes from the previous question: Android Studio run configuration for ORMLite config generation
I was able to get my configuration to run this one class, but it is still failing with
Could not find raw directory
This is my source
package com.ilopez.android.machinesounds;
import com.j256.ormlite.android.apptools.OrmLiteConfigUtil;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
/**
* Created by User on 7/25/13.
*/
public class DatabaseConfigUtil extends OrmLiteConfigUtil {
private static final Class<?>[] classes = new Class[]{
RecordedSound.class,
};
public static void main(String[] args) throws IOException, SQLException {
writeConfigFile(new File("G:\\MachineSoundsProject\\MachineSounds\\src\\main\\res\\raw\\ormlite_config.txt"), classes );
}
}
My platform is windows, and I cant really figure out why it keeps failing with "could not find raw directory".
This is the command my android studio runs:
"C:\Program Files\Java\jdk1.6.0_37\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\Android\android-studio\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\Android\android-studio\sdk\platforms\android-17\android.jar;C:\Program Files (x86)\Android\android-studio\sdk\platforms\android-17\data\res;C:\Program Files (x86)\Android\android-studio\sdk\tools\support\annotations.jar;C:\local\Dropbox\git\MachineSoundsProject\MachineSounds\build\classes\debug;C:\Program Files (x86)\Android\android-studio\sdk\extras\android\m2repository\com\android\support\support-v4\13.0.0\support-v4-13.0.0.jar;C:\local\Dropbox\git\MachineSoundsProject\MachineSounds\libs\ormlite-android-4.45.jar;C:\local\Dropbox\git\MachineSoundsProject\MachineSounds\libs\ormlite-core-4.45.jar;C:\local\Dropbox\git\MachineSoundsProject\MachineSounds\libs\ormlite-jdbc-4.45.jar;C:\Program Files (x86)\Android\android-studio\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.ilopez.android.machinesounds.DatabaseConfigUtil
I'm using version 4.45 of ORMLite
You can use Android Studio with no problem, but make sure in edit configurations to select standard JDK and (important!) to modify "Working directory" by selecting the "main" folder of your android project
It should be something like: /your_workspace/your_project/app/src/main