Obsolete
Status Update
Comments
cs...@gmail.com <cs...@gmail.com> #2
I had the same problem today, and this could be related to https://code.google.com/p/android/issues/detail?id=67376
As a temporary fix, I changed the build.gradle from
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
to:
dependencies {
classpath 'com.android.tools.build:gradle:0.9.0'
}
As a temporary fix, I changed the build.gradle from
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
to:
dependencies {
classpath 'com.android.tools.build:gradle:0.9.0'
}
ro...@gmail.com <ro...@gmail.com> #3
That seems to have worked around the problem - thank you very much.
Maybe this should be merged into 67376?
Maybe this should be merged into 67376?
al...@gmail.com <al...@gmail.com> #4
The same problem when using list navigation mode. Just place the following line in onCreate() to get an app crash!
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
[Deleted User] <[Deleted User]> #5
You saved my day - Thx
zi...@gmail.com <zi...@gmail.com> #6
mark, i had same problem, Thx
lo...@gmail.com <lo...@gmail.com> #7
same Issue down here, I had references to Appcompat theme in my layout file. Passing Gradle plugin version to 0.9.0 fix it. Thanks !
ro...@gmail.com <ro...@gmail.com> #8
This looks like it has been resolved - I've upgraded all components to the latest version, gone back to
classpath 'com.android.tools.build:gradle:0.9.+'
and code that broke before now works fine.
classpath 'com.android.tools.build:gradle:0.9.+'
and code that broke before now works fine.
lo...@gmail.com <lo...@gmail.com> #9
I confirm, it's working now.
pe...@gmail.com <pe...@gmail.com> #10
I'm using the latest Android Studio (1.0 rc2) and how can I fix it without compiling on the command line?
en...@google.com <en...@google.com>
bu...@gmail.com <bu...@gmail.com> #11
am using eclipse how could this be solved
Description
We have a version of our app in the Play Store that uses the same search code (though it uses an older version of appcompat-v7, and built with older build tools). That version works fine on devices that are affected by this issue. The search code and configuration have not changed since that version was released, though we've moved over to Android Studio + Gradle from IntelliJ 12. I've successfully run the app on older devices since that change.
I've attached a simple sample project that reproduces the error, and the logcat output when it's run on the 2.3.3 emulator. The key line in the log seems to be:
Could not find class 'android.support.v7.widget.SearchView$5', referenced from method android.support.v7.widget.SearchView.addOnLayoutChangeListenerToDropDownAnchorSDK11
The sample project runs fine on my Nexus 5 (Android 4.4.2, an Acer A500 tablet (Android 4.0.3) and the Android 3.0 emulator.
It crashes on Android 2.3.3 and Android 2.2 emulators and on 2 different devices (HTC Desire HD A9191 on Android 2.3.5, Samsung Galaxy S GT-I9000 on Android 2.3.3).
It seems strange that an SDK11 method is being called when the device SDK is 10, and that strangeness seems consistent with the app working on API11+ devices but not below.
As far as I can tell the only thing that has changed since I last successfully built and ran the app on a 2.3 device a few days ago is that I ran an SDK update yesterday. My versions are as follows:
Android Studio 0.5.1 (on OS X 10.9.2, running on compiling with Oracle Java 1.7.0_51)
SDK Tools 22.6.1
Platform-tools 19.0.1
Build-tools 19.0.3
SDK Platform 19 rev 3
Support Repository rev 4
-------
Menu XML:
<menu xmlns:android="
xmlns:app="
<item
android:id="@+id/action_search"
android:title="@string/action_search"
android:icon="@drawable/abc_ic_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom" />
</menu>
MainActivity:
import android.os.Build;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
...
public boolean onCreateOptionsMenu(Menu menu) {
// Removing this prevents the crash:
getMenuInflater().inflate(R.menu.main, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
return true;
}
build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.0.1'
compile 'com.android.support:appcompat-v7:19.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
}