Error : Could not find HelloAndroid.apk - java

I am very new to Android development. I followed every steps from developer.com to install ADK. Now my issue is, when I tried to run HelloAndroid application, I get an error as I mentioned in the title.
I hav JRE1.6 installed. Is tat enuf? Because I read tat ether jdk or jre is ok. I am clearly blank about the concept of this apk error. And I am using Eclipse Ganymede. Kindly give a solution for my issue. Thank You. :)

Try in eclipse: Project -> Clean... -> Your android project
Helped in my case. However, I was developing and successful building apk's with eclipse for months before this error occurred.

I had the same problem, I resolved it by re-booting eclipse. I suggest you try this first.

I can spot one major issue.
JRE alone is insufficient. Here is an extract of their development system requirements.
JDK 5 or JDK 6 (JRE alone is not sufficient)
Here you can find their page on system requirements. http://developer.android.com/sdk/requirements.html
I'm not sure but I guess your error comes from not having the JDK installed.

I had the same issue which I solved by using JRE system library 1.6 instead of 1.5. My post cronicles all the other solutions I've seen online, hope it helps.
apk issue post

I encountered this problem and didn't really see easy advice on the internet. To fix it, I followed these steps. #1 may not be necessary, so try #2 first alone.
Upgrade the JDK from 1.5 to
1.6. Even if you bypass this step, ensure you have a JDK installed.
Removed/Delete the project completely then create a new HelloAndroid project. A config setting is occasionally off. Obviously back up the source code if the project is more important to you than a Hello World application.
If it works, you may encounter a timeout error after launch when the HelloAndroid.apk is installing in your emulator. Change the timeout from 5000ms to 10000ms in
Windows -> Preferences -> Android -> DDMS -> ADB Connection timeout(ms).
Good luck!

Related

IntelliJ IDEA: "cannot resolve symbol" for String, System and other Java classes

I recently downloaded IntelliJ IDEA to a different computer. On one computer it works fine on the other computer it is giving me this current issue.
When i open a new project with a template it automatically shows errors everywhere even though it allows the code to run and shows the output correctly: standard Java library classes like String and System are highlighted in red and the error tooltip says: "cannot resolve symbol".
I have tried "Invalidate caches/Restart", but it didn't help.
Check the JDK configuration Classpath tab in Project Structure | SDKs:
Also check that project and modules use the same JDK.
If it's empty, remove the JDK and add it again. It's not recommended to use JetBrains Runtime as your JDK, download and configure some different standalone JDK instead, 2020.1 version can download JDK for you.
Important notice
The bundled JRE is used for running the IDE itself,
and it's not sufficient for developing Java applications. Before you
start developing in Java, download and install a standalone JDK build.
I tried above, but no luck. I did get it working with File -> Invalidate Caches...
I selected all three checkboxes and then "Invalidate and Restart". That worked for me.
Often this means there is an issue with your java compiler. Normally this issue arises on an initial Intellij install. You can install/update the java compiler to get it working properly.
Go to the editor and type Ctrl + Alt + Shift + A . Then, a little bar pops down and you can select to either install the compiler, or configure it. Both times this happened to me, I just clicked install and once it was done, everything worked. If the install doesn't work, you can just reconfigure your compiler.
Removing the Java SDK and adding it back under File->Project Structure did it for me.
The only thing that worked for me (after hours of trying!) was to use the Android Studio's embedded JDK. "Invalidate caches/Restart" did not solve the issue, even using the same JDK version which was not coming with Android Studio was giving the Cannot resolve symbol 'String' errors. Wonder what's so special with this pre-packaged JDK! Hmmm
For me the solution seems to have been creating a new Run Configuration.
I had tried deleting the SDKs, and re-adding the one I needed but that did not clear the error. But creating a new Run Configuration did the trick.
I had this problem when I uninstalled JDK and re installed it, and when I was making a new project I had the uninstalled JDK file selected, which somehow caused the system to be in red and un run-able.

Eclipse internal error "Polling news feeds"

I'm using Eclipse(4.9.0) on my MacBook (High Sierra, Java 11) and this error is showing sometimes, if I'm on another app, the errors create a "stack" as you see in the screenshot, it is annoying to come back to Eclipse and to close this error every time.
Can somebody help me solve this?
This indeed seems to be an issue when Eclipse is run with Java 11. I have created Bug 539545 to report this.
In the meantime, you can work around this issue by disabling news feed polling. To do so, go to Preferences... -> General -> News, and untick the Enable automatic news polling option:
The error window will no longer appear.
This is caused by the http://openjdk.java.net/jeps/320 - which is removal of Java EE and CORBA Modules from the standard Java 11 version.
As mentioned by #Pyves, the simple way would be unchecking "Enable automatic news polling" from the Preferences-> General -> News
But if you still need this, you can install "javax.*" bundles from the eclipse orbit repository.
Here is the latest stable repo url:
http://download.eclipse.org/tools/orbit/downloads/drops/R20180905201904/repository
Turning off the news feed does solve this problem (Per #Pyves, unchecking "Enable automatic news polling" from Preferences-> General -> News), but be aware that you may get other issues because of the too-new JDK. Noga Rotman just spent several hours working out for me that Eclipse not being able to find JUnit, even though it was installed and correctly on the classpath, was because of using the new JDK (the one that is causing these same issues).
You can solve the underlying issue by uninstalling your current version of the JDK and installing an old version, then reinstalling Eclipse.
If you have the Oracle JDK you can find uninstall instructions here and and Java SE Development Kit 8u191 (which fixed my issues) is here.
For windows version Eclipse,
Enter search key string "news"
Check off "Enable automatic news polling"
Click [Apply and Close] button.
That's it.

Unable to install jdk-8u101-windows-x64 in system

After uninstalled the java in my computer, i have downloaded latest version jdk-8u101-windows-x64.exe and tried to install it. but unfortunately at end of installation i got the error code as,
Error message which i got during installation
I have followed the steps as described in the java help site. but nothing gives me the solution. Because of this i cant even launch the Eclipse to code.
From Oracle site,
This is a known issue.
Error 1603: Java Update did not complete.
WORKAROUND This is a known issue, and we are still investigating the
root cause. Meanwhile you can try the following to install Java.
Workarounds:
Option 1: Restart your system and uninstall old versions
Option 2: Disable Java content through the Java Control Panel
You can follow more detailed steps from this official link.
Follow the link, it is an issue with Java it is under investigation
https://www.java.com/en/download/help/error_1603.xml

JavaFX on Android - Gradle can't find JDK

I'm trying to get JavaFX applications to run on Android by using the Dalvik JavaFX-Android SDK (provided by the JavaFX Android porting team). So I downloaded the samples provided by the JavaFX Android porting team and have been trying to run one of them on Android without much success.
Using Eclipse with the Gradle plugin I imported the "HelloWorldFxml" sample project. Then I ran the Gradle task "./gradlew androidInstall" on the project like the README file told me. But unfortunately the task cannot execute because Gradle cannot locate my JDK:
(source: forumbilder.se)
Even though my JAVA_HOME system variable is correctly set and I havn't had a problem with it before:
(source: forumbilder.se)
Anyone that can provide some insight as to how I can fix this?
Versions: Eclipse Luna Service Release 1a (4.4.1), Gradle 2.2, dalvik-sdk-8u40-ea3, Android SDK Build-tools 21.1.2, Android SDK Tools 24.0.2
Edit: The console output when running "gradlew androidinstall" on a sample project:
Even though the error message doesn't specify it, maybe it's looking for javac in your PATH? In case it's not in there try adding ;%JAVA_HOME%\bin to the end of your PATH variable (and restart Eclipse afterwards, I've had the problem of running processes not getting changes to environment variables before).
Check the Java setting in Eclipse:
Window -> Preferences
Java -> Installed JREs
Make sure that your JDK 1.8 is listed there. If it's not, add it using the Add... button.
Once the JDK is known to Eclipse, make sure that your project's settings use that JDK as a compiler, and the Gradle plugin should be able to pick up the setting from there.
In a pinch, you should also be able to run Gradle from the command line, and it should work fine since you already set the %JAVA_HOME% variable.
Basic Note
Since the release of dalvik-sdk-8u40-ea3, and in very short time, the JavaFXPorts team has released a few new versions, all of them simplifying all the process of porting a JavaFX application to Android or iOS.
They released dalvik-sdk-8u40-ea4 and they announced the release of a new plugin, that will simplify to the minimum the steps to create a mobile application from JavaFX.
While this answer may not help the OP in his particular problem, definitely it will help him and others, since everything is really simplified.
New approach
With this plugin, there's a new way of creating the HelloWorldFxml application for Android.
The new javafxmobile-plugin allows you to generate the apk with a single 'build.gradle' file.
You can find this an other basic samples here, and download the repository here.
You won't need to edit a single line, just type this on the command line, on the root of the sample, with your device connected:
gradlew androidInstall
As for previous releases, you will need JDK8u40 and Android SDK installed. No need for dalvik-sdk though, it's retrieved by the plugin.
Notice that you can open these samples from your IDE, so you will be able to modify them, and run them locally or build again the apk for your device.
Had this problem, too.
My proberties:
-Windows 7
-Dalvik SDK (dalvik-sdk-8u60-b5)
-JDK 8 (newest Version 8_60 / IMPORTANT: JDK not JRE)
-And I tried also the HelloAndroid project provided by the Dalvik-SDK-download.
So i execute the command line: gradlew installDebug
My probelm was nearly the same.
"Fail to find JDK. Please make sure there is a JAVA_HOME or JAVA8_HOME systemvariable."
#1
Created these proberties. Just like described in this post:
How to set java_home on Windows 7?
So to make everything sure, I created both with the same path. Cause I don't know exactly which one is used by gradle.
#2
This is really the hack that helps me out. Found this also in StackOverflow.
Write in your build.gradle under the android{..} stuff this line:
retrolambda {
jdk 'C:/Program Files/Java/jdk1.8.0_60' //<--your JDK-path
}
it looks like that
Then execute the same command line again and it worked for me.
I think only the 2. steps was the solution, cause I guess gradle don't look for the variable if there is a direct path to the jdk.

Android Studio - Can't open AVD/SDK

Sorry if this is the wrong Stack Exchange, but this is where most of the questions were asked when I googled my problem.
For some time now I've been having problems with Android Studio and the AVD/SDK. It seems to be a relatively common problem, but I haven't been able to fix my problem with any of the solutions that worked for everyone else. This is the error I'm getting whenever I try and run the AVD or the SDK:
Cannot launch AVD manager.
Output:
Access is denied.
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.
You can find the complete Android SDK requirements here:
http://developer.android.com/sdk/requirements.html
I've tried re-installing everything Java (Both JRE and JDK), reinstalling Android Studio, running as admin, configuring permissions and a bunch of other stuff. I'm running Windows 7 and I've tried both JDK/JRE 6, 7 and 8 (JDK 6 worked very poorly though). I don't really know what kind of information you need to help me solve this problem, but I'll supply any information needed as fast as I can. Thank you very much.
Edit:
Please note that Java IS installed. Both Java and Javac is working fine in cmd.
I can suggest that Go to Windows -> Preference -> Java -> Compiler
And try with different java version.
Probably your Java folders are in the path (and that's why they work from CMD) but your JAVA_HOME is not defined.
As you are on Windows try creating a System Variable following those steps
Try (re)installing the ADT and see if it works. If not, go to the sdk's root folder ([PATH TO THE UNZIPPED ADT]/sdk) and open the AVD Manager.exe. Does it still give you the same error? If not, try to open the SDK Manager.exe and make sure you've installed all the propper APIs. I'd recommend installing at least the SDK Tools and Platfom-tools, and all of API19 (Android 4.4.2).
Finally Solved my problem! Some software I had previously installed had created a Path in User Variables, which was the one I was using for my JDK path. I tried using the Path in System Variables and it worked just fine! Thanks to everyone who took time to help me.

Categories

Resources