android-support-v7-appcompat error on eclipse [duplicate] - java

After upgrading to Android Studio 1.3.1 yesterday, Getting this error when building projects, I cannot create a new project. Adding error and build.gradle file below :
Alredy tried changing compileSdkVersion and buildToolVersion to 21.

Every major revision of the Support Library, such as the 23.0.0 AppCompat you are using, compiles against the API level of the same number: i.e., API 23 as per this G+ post from the AppCompat developer. Therefore to use 23.0.0, you must update your compileSdkVersion to 23.
Note this is completely different from targeting API 23 (which can be done separately and is what is required to use the runtime permissions model).

Related

Android SDK sources : Source code does not match bytecode

SDK versions:
compile SDK version : 27
target SDK version : 27
min SDK version : 23
Samsung tablet SDK version : 25 (Android 7.1.1)
I have sources installed for SDK version 25 and 27, but when stepping into SDK code I get an error "Byte code doesn't match source code". The source file opened is for SDK version 25.
This only happens for some android modules (android.widget, android.app) while others work fine (android.os).
The app source also contains some legacy and deprecated features.
Is there a way to
a) Find out what causes the mismatch or
b) Switch to decompiled source code
Its better to restart your android studio and make a clean fixed it for me

Unable to load class 'com.google.gson.JsonObject'

I am trying to include firebase SDK in my Android Studio Project. But it giving me an error. I am using latest JDK version (1.7.0_71) and it is asking for upgrading higher version to (1.7.0_67).
I need help for basic firebase setup SDK on android. I tried to setup it by the reference of following link: https://firebase.google.com/docs/android/setup#add_the_sdk.
I am getting following error: Please check attached screenshot
I had the same problem trying to GCM to an old android project.
The solution for me was to also add
classpath 'com.android.tools.build:gradle:2.1.2'
to the top-level build file dependencies, just before classpath 'com.google.gms:google-services:3.0.0'. For the old android project, this dependency only existed in the module-level build file.
Make sure you are using Android Studio 1.5 or above. Just saw a guy who had the same issue and he was using android studio 1.0.1
Updating the Android Studio will fix it for you. Also check other pre-requisites.
Prerequisites from official documentation are as follows:
A device running Android 2.3 (Gingerbread) or newer, and Google Play services 9.2.1 or newer
The Google Play services SDK from the Android SDK Manager
Android Studio 1.5 or higher
An Android Studio project and its package name
First of all complete all the steps mentioned in a link you had followed for Firebase
And note that it requires active internet connection so please check internet connection and add both project and app level dependencies as per suggested in link of Firebase you had used in question
Also it is best to use JDK version 1.8 and above because oracle officialy ended support for those versions. If you are working with Firebase Api which is quiet new so i would highly recommend as it is also recommended by most professionals including developers at Google.Or if you want to go with JDK 1.7 then update it to latest Jdk 7u80 or 7u79 at least because it has least issues comparing to older versions.
The best solution is use JDK version 1.8 and follow all the steps in link https://firebase.google.com/docs/android/setup#add_the_sdk
Ensure that you have the google-services.json file, with the client id: <effective package name>, in the app directory. This you download from the Firebase console when you add an app.

Android SDK issues?

I imported my project recently. I face the issue that is sometime It can not reference Android Java class.
and more ..
But when I open the Android SDK code. The missing class is available. Does anyone know why it says "Cannot resolve symbol"
I also tried to invalidate Android Studio Caches and Restart but it still has the issues.
Gradle build errors:
Check which android sdk you are compiling for compatibility with. Though you may be targetting 21, if you are requesting compatibility with an older version it will not let you use new classes. If that is the case, up the minSdkVersion setting in your gradle file, such as to
minSdkVersion 21

Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 14

So i recently switched the target of my android project to 4.0. Now i have practically errors on every line and the error "Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 14" on the console. So my question is, how do i change this to work with api 14 and compile? thanks.
If you're supporting API levels < 19 (4.4)
In eclipse:
Right click your project -> properties -> from the side bar, pick "Java Compiler" and then change Compiler compliance level to 1.6
If you're support API levels >= 19
You shouldn't see this issue. If you do, make sure that your project's minSdkVersion is properly configured.
I disagree with #Eran, this error cause by setting Project build target to 4.0 (API 14). If change to Java 1.6, you'll can't use Java 1.7 sode style, for ex: ArrayList myArrayList = new ArrayList<>();.
To fix this, set your target to 4.4 (API 19) or higher.
Below steps solved error in my Eclipse project
Go to android project
right click on the project
select properties
There is a option named 'Android' in right side menu
Select higher level API then API 14 or any other API that's installed in you SDK manager
and you're done.

android app deployment issue

i had an android app and the target for the app i selected is Android 4.0.3 API Level 15.
And by connecting an android phone to my machine i copied the apk file from my machine to the phone.
But the problem is the phone that am using for testing the app is on Android version 2.3.6 installed.
I think thats why when am double click on the apk file to install on device it is showing an error like There is a problem parsing the package.
How can it be solved.?
In your manifest include a minimum SDK version along with your target like this:
<uses-sdk android:minSdkVersion="4" />
<uses-sdk android:targetSdkVersion="15" />
In your manifest you'll have to change the minsdkversion to suit the test phone, or else it will not work.
Be careful how you do this as obviously many classes have been added to Android between v2.3.x and 4.x. Not only that but even classes which existed for 2.3.x may have had methods and/or constants added to them.
As others have said, simply set your min and target SDK manifest entries but be aware that if you use any classes only available after v2.3.x, you will get runtime exceptions when trying to test.
In general I can see you running into trouble - if you really need the 4.x API then you will never be able to test on the 2.3.6 device and you will have to use an emulator. If, on the other hand, you will only be using classes available in v2.3.x then there is no point in targeting v4.x at all. In that case simply target v2.3.x instead.
You need to set minSDK version 2.3, if you want to run APK in your mopbile.
App is build for Android 4.0.3 API level 15, You must set minSDKVersion in manifest file of the project. By setting minSDKVersion app will run on all later Android OS versions. For example if you set it to 7, app will run on API Level 7 onwards. Not on 3, 4, 5 or 6.

Categories