Error: Source not found in Android - java

I am developing an android application which I have complied using API 14 initially, and now I am updating the API version to the latest one. when I debug the code then I am getting the error "Source not found". I am using Eclipse classic and developing on windows 7. I have searched a lot but didn't find a good solution so that I can get rid of from this problem. please help me or guide me how I can download the correct source code using windows 7. I have gone through different links such as android.opensourceror.org
but it is out dated.

You can attach android source code from Android SDK manager. Just check the option for Source for Android SDK option or using this plugin for Eclipse adt-addons

Related

Unable to render design of XML in Android Studio

I have installed java 1.8 and installed Android Studios. After I started a new project (Blank activity), I tried to click on the 'design' tab of the xml file display screen.
However I am hitting this error
I checked my configuration and saw that I already have my java 1.8 setup in the IDE.
Any advise on how I can resolve this issue?
Thanks
Try switching the UI render to an older version of Android
Possible duplicate of Android N requires the IDE to be running with Java 1.8 or later?
Maybe this answer for Mac in that question will help you: https://stackoverflow.com/a/38493792/6714194

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.

Eclipse ADT not generating MainActivity

I am having an immensely frustrating issue with Eclipse and the ADT after updating all the SDK's, API's and Support Libraries for Android this week.
Ever since updating everything I am unable to properly create an Android Project in Eclipse. It does not generate the MainActivity.java or the main_layout.xml files at all. I have read through most of the other posts regarding this and the fixes they suggest don't seem to work. I have tried looking for the updated software by going to:
Help --> Check for updates (Everything is up-to-date).
I have also tried the manual way by going to:
Help --> Install New Software and inputting https://dl-ssl.google.com/android/eclipse/
It still says I have the latest version of the ADT.
I have also tried reinstalling the ADT plugin as well, but to not avail.
Trying to create an Activity after project creation also does not work.
Versions of software that I am running:
Android SDK Tools 24.0.1
Android API 1.5 up to and including API 5.0.1
Eclipse: Luna Service Release 1(4.4.1)
ADT Plugin Not sure
Thank you for taking the time to read this.
The ADT and SDK Tools must be compatible. The latest ADT version is "ADT 23.0.4". And the corresponding SDK Tools version is 23.0.5. You have updated your SDK Tools version to 24.0.1, but there are no ADT version can support. So you should roolback to the SDK Tool version 23.0.5.
Here is the link:
https://dl-ssl.google.com/android/repository/tools_r23.0.5-windows.zip
Add an Empty Activity, instead of Blank Activity. This will generate MainActivity.java
What is your Java version? You didn't mention about it. Please check it, it should be Java 7 for Android 5.0. If you have Java 7 then check eclipse.ini file. If it refers to Java 6 then change here also to Java 7.
Google fixed this issue and below link may help you.
https://code.google.com/p/android/issues/detail?id=82393

RegisterActivity: cannot be resolved to a type, AppEngine

I have set up my computer with windows 8.1 completely new (formatted), to be sure to have a working system.
I have installed Eclipse and the plugins the following way:
download and unpack eclipse Kepler
install JDK
install android SDK
install android SDK-plugins in eclipse
in android sdk: install all extras, API 19, in tools: Android SDK Tools, Android SDK-Platform Tools, Android SDK Build Tools (only newest, 19.0.3)
install all google plugins for kepler(Google App Engine Tools for Android, Google Plugin for eclipse, GWT Designer for GPE, SDKs)
Now, is everything set up correctly, to use google app engine correctly?
When I create a new app engine connected android project, google creates a bugged project.
I have 50 errors, of which 49 can be resolved by changing the Java version from 1.4 to 1.7 in the app engine project (Properties: Java Compiler and Project Facet)
However in the non-appengine project, in the MainActivity I get following error:
RegisterActivity cannot be resolved to a type.
How to solve this? I did not do anything by myself yet, I only created a project and I already have an error...
You are very thorough, which is good. Your development installation appears to have flaws, and you might be trying to make it run before you have seen it walk. You need to divide and conquer the potential problems. Initially simplify what you aim to create.
To pinpoint the errors, try the two standard tutorials before starting on your own design: first build and deploy an AppEngine project without Android components, and only after that works, build and deploy an Android to AppEngine project. Somewhere along that process your errors will show up, and then you should have a more specific piece of source code to show and discuss in this question.
Yesterday, a new version of Android SDK (22.6.2) was released. Apparently, the problem with RegisterActivity was solved in this update. Now I can create an Appengine connected Android Project without any errors!

Cannot create android application using eclipse

NOTE: I have already fixed this problem. I used the methods described in a previous question/answer discussion. Thank you for whoever tagged this as previously answered!
It an be found here: ADT 22.2 New App Wizard: Unsupported template dependency: Upgrade your Android Eclipse plugin
Today I just downloaded and installed Eclipse via the developer.android.com tutorials. I had almost initiated my first Android Application when I came across this error:
I don't understand the error. It does not specify a required version, and my version is the most up to date version. Neither the [Install/Upgrade] nor the [Check Again] buttons appear to function. I have also tried to delete and reinstall the Android Support Library via the SDK Manager multiple times.
Can any one help me? Thanks in advance!
Note - I do in fact have both the Android Support Library and Android 4.3 installed:
*Edited to add picture and note*
How did you create your project? Steps: New -> Android Application Project? If you've done this, you should check whether you have installed "Android 4.3" and "Extras->Android Support Library" in Android SDK Manager.
Go to the Android SDK Manager, then download the required Android version, in your case, version 18 which is Android 4.3.
Right click on the project -> properties -> Android -> select a platform like 4.0
It sounds like you don't have installed android 4.3 sdk(API level 18).
Please open eclipse->windows->android sdk manager and make sure your android 4.3(API 18) status is installed.
Download from http://dl-ssl.google.com/android/repository/tools_r22-windows.zip, unzip it and replace the /tools folder with this one to downgrade the sdk tools. There's a bug in version 22.
Sorry, but someone found that this is a duplicate. I replaced my sdk/tools/templates/activities folder with a more up-to-date one, which resulted in success. The steps and files can be found here:
(ADT 22.2 New App Wizard: Unsupported template dependency: Upgrade your Android Eclipse plugin)
Thank you for all who took time to try and answer my questions. It is much appreciated!

Categories