ContextThemeWrapper not working - android

Error:(11, 40) error: package android.support.v7.internal.view does not exist
Error:(30, 25) error: cannot find symbol class ContextThemeWrapper
I get that error even though in my gradle I have this included. What is the solution? not a strange error? I cannot run my app because of this error and its annoying. I have no jar in my libs folder as well.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}

There is a change in appcompat-v7:23.1.1, some elements inside package android.support.v7.internal.view were moved to android.support.v7.view. Changing your imports may solve the problem.
For more info check this answer
Or simply rollback appcompat-v7 to 23.0.1 in your build.gradle
Hope it helps!!

Related

com.mcruiseon.buseeta E/dalvikvm: Unable to resolve Lmy/library/class/file; annotation class 8906

My library project starts like this
#XmlRootElement(name = "GetUserDomainOrGroupMasterResponse")
#XmlAccessorType(XmlAccessType.FIELD)
public class GetUserDomainOrGroupMasterResponse implements Serializable,
I have built a jar, and copied this jar to the libs folder of my android project using android studio.
My gradle file in my android studio project has
compile fileTree(dir: 'libs', include: ['*.jar'])
I also tried adding
compile files('libs/mylibrary.jar')
When I open the jar archive the class file is RIGHT THERE
Now, when I run my project I get a
com.myapp.package E/dalvikvm: Unable to resolve Lmy/library/class/file; annotation class 8906
I have tried
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/mylibrary.jar')
compile files('libs/mylibrary.jar')
3.
compile fileTree(dir: 'libs', include: ['*.jar'])
I have also tried building a executable jar for my jar file and still I get the damn Error
I dont get it. What am I missing here ?
Edit
I noticed that the app does not have any side effect due to this Error. In any case its a irritant. Please help me resolve this.
#XmlRootElement annotation has retention RUNTIME in jaxb-api. This annotation should be available in runtime as normal classes (https://en.wikipedia.org/wiki/Java_annotation).
Since your library compiled against jaxb it has a notion of this annotation, but it is not included and can not be found in runtime.
As a solution, you could add jaxb as compile dependency to your app (several Mb plus) or add just this annotation definition to your android project.

Gradle doesn't find acra

I have an Android project in which I have been using ACRA 4.6.0 with a static jar file, all working fine. I have tried to change this to use the latest ACRA by the maven dependency in build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
testCompile 'junit:junit:4.12'
compile 'ch.acra:acra:4.8.5'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
in my build.gradle. However this causes the build to fail with errors like:
CJApp.java:13: error: cannot find symbol
import org.acra.ACRAConfiguration;
^
symbol: class ACRAConfiguration
location: package org.acra
So far as I can tell gradle is not downloading anything for acra. I have tried adding mavenCentral() to the repositories list with no effect.
What else do I need to do, and is there any way of determining just what gradle has downloaded?
Are you sure that the class org.acra.ACRAConfiguration is included in the new version: acra:4.8.5 which you're suddenly linking to? If not, this is a simple matter of incompatibility. In that case, it should be resolved if you step the version back to 4.6.0.
Have you checked that the build downloads the file from Maven Central? This should be clearly visible when giving gradle the -i flag - it will print every URL as it downloads them.
ACRAConfiguration has moved to org.acra.config. Just adjust your import.

Android Studio: import com.android.volley.xxxx Cannot Resolve Symbol 'xxxx'

So, I followed this tutorial to create a ListView with images using Volley but I am having this issue with the com.android.volley.xxxx import statements in LruBitmapCache.java, AppController.java, CustomListAdapter.java, and MainActivity.java. It shows as Unused import statements and its extension are in red saying Cannot resolve symbol xxxx. Volley.jar is already aded to app -> libs section.
Would appreciate any help.
I'd double check to make sure your build.gradle includes:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
...
}
And also make sure you've ran a sync.
Add
compile 'com.mcxiaoke.volley:library:1.0.6#aar'
to your Gradle dependencies...
Add this in your build.gradle of your app
https://developer.android.com/training/volley/
implementation 'com.android.volley:volley:1.1.1'

Why my app is errors when I just create it?

I use android studio with sdk v24.
When I create my new application and just go to the MainActivity.jar It shows me many codes red?
Here it is that I'm talking about:(screen shot)
https://dl.dropboxusercontent.com/u/100174344/Screenshot%202015-01-06%2008.06.09.png
I'm really confused. How can I fix these errors?
NOTE: my sdk is up to date (as you see here: https://dl.dropboxusercontent.com/u/100174344/Screenshot%202015-01-06%2008.22.28.png )
and I've added this code to my build.gradle(Module: app) :
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3' }
EDIT:
I'm sorry I create a new project and still it show me the codes, red but I can run it in AVD. what's the problem?
You want To add android.support.v7.jar not added that y i think this error occurs.
add this in your project property file
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.+'
}
Did you added android.support.v7.jar? Just make sure your sdk is updated and you've added android.support.v7.jar. Also check the dependencies.
You need to add appcompat v7 dependencies to the app gradle file.
Ensure build.gradle(Module : app) is having the dependency.
If not available then add and sync the project
It should be like-
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.+'
}
I found the problem
I don't know why but when I changed the theme by this structure the issue is up.

gradle android proguard error

I am having this issue and seem can't figure it out when building gradle android with proguard:
Can't read [C:\Users\xxx\dev\xyz\Xyz-nextgen\build\exploded-bundles\XyzCommonXyz_volleyUnspecified.aar\libs\android-support-v13.jar(;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [android/support/a/a/b.class == android-support-v13.jar:android/support/v13/app/FragmentCompat$FragmentCompatImpl.class])
There are 3 library projects and one app project.
All projects use only one android-support-v13.jar.
Thanks.
Andy
Open the module's gradle.build file and
In
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/android-async-http-1.3.1.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}
Change
compile 'com.android.support:support-v4:13.0.+'
To
compile 'com.android.support:support-v4:21.+'
make sure u have updated build tools in the sdk manager and let us know if that works

Categories

Resources