Когато стартирам на емулатора, той работи добре (API 21), но когато го стартирам на моето устройство Nexus 7 (API 19), той се срива със следното проследяване на стека.
Проследяване на стека
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$attr
at android.support.v7.app.ActionBarActivityDelegateBase.ensureSubDecor(ActionBarActivityDelegateBase.java:263)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:225)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at uwi.dcit.AgriExpenseTT.MainMenu.onCreate(MainMenu.java:40)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Само за справка опитах да синхронизирам с gradle, почистване, повторно изграждане, SDK за поддръжка са изтеглени и зависимостите са зададени. Точно както е посочено тук http://developer.android.com/tools/support-library/setup.html#add-library
Build.gradle за приложение
apply plugin: 'android'
repositories {
mavenCentral();
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
//compile'com.google.api-client:google-api-client-android:1.19.0'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:multidex:1.0.0'
compile project(path: ':AgriExpenseBackend', configuration: 'android-endpoints')
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 21
multiDexEnabled true
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
dexOptions {
preDexLibraries = false
incremental true
javaMaxHeapSize "4g"
}
}
библиотеки
gson-2.1.jar, poi-3.10-FINAL-20140208.jar
Всяка помощ или предложения се оценяват