android - .apk file is not modified - android

i run the application using eclipse at this .apk file is not modified. Suppose i used the .apk file in the device at the installation time i got the “Parse Error : There is a problem parsing the package”. How to solve this? can anybody help me.
For this i deleted the .apk file from the bin folder and after run the app using eclipse. Generally in this case .apk file is generated. but here it is not generated. but .class file are generated.

I got this errors in 2 cases-
When I changed the package name of the app (In that case, uninstall old and run it again)
When you install this APK from Gmail in < Android 2.2 phones.
Since you are getting this in Eclipse, did you change the package name or edited in Manifest?

Try: Project -> Clean.
Or, try: Right click on project -> Android Tools -> Fix Project Properties.
In the same menu you can change the package project.

Related

Fails to generate apk file

Ok, so recently I've been trying to run my application on Android Studio (1.1.0), but every time I try to run it, the following error pops up:
Waiting for device
Target device: samsung-blah-blahblah
Uploading file local path: C:\Users\jimmykim9001\AndroidStudioProjects\blahblah\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/blah.com.blah
Local path doesn't exist.
Now by doing some research I've come to this link: https://www.youtube.com/watch?v=i4WcMIyc8OQ This would have been helpful if I was able to find my apk files when searching my project; however, they're not there, which is strange because I'm pretty sure they're supposed to be created automatically. So I tried to rebuild the project, but that fails half-way through (Failed to complete Gradle execution. Cause: ). What I need to do is get Android Studio to generate the app-debug.apk file, but I have no idea how. All the links I've found involve moving the file into the right place, but the file itself doesn't exist for me. Any ideas?
Note: I imported a jar file recently and ever since I did that, the problems started. Not sure if this matters or not.
I got your question. I have also faced the same problem some time ago. Let me clue you in , here is some approach i would like to try :-
Your apk must be here ( if it have been automatically generated)
your_app_name\app\build\outputs\apk
If app-debug.apk is not there then , Clear the cache File -> Invalidate Cache, then restart your IDE . Then rebuild it.
Try removing the jar you have recently added and rebuild the project.
you can try re-importing your project.
From above all what worked for me 1st point . Try these .................................best of luck.
Here are some links you might like to see....
Build unsigned APK file with Android Studio
Apk location in New Android Studio

APK path is not specified when trying to run app using IntellIJ

I am learning to create Android apps. My device is a Galaxy Note 3. When I run the app I get the error APK path is not specified. I have tried
Restarting the IDE and running as admin.
Tried messing with Project Structure.
Created a new project. Did not change any settings from defaults.
Tried creating various directories in the project directory.
Tried the instructions here that would push the app using a APK. Only thing now is that I need to figure out how to create a APK before running (obviously)
After trying for 6 hours and noticing using Eclipse was working fine. I renamed the .IntelliJIdea12 to generate a new profile. That fixed it.
I got it working. The error occurs because of apk path mismatch. Configuring the apk path as below should get it working.
In your module's .iml file specify the APK_PATH option:
<option name="APK_PATH" value="/build/apk/YourAppName-debug-unaligned.apk" />
Note: Your apk might not be located at /build/apk/. You can physically locate the apk by navigating through your app location and mention the path to that directory here.
Now rebuild your project. It should build and work as expected.

Trying to execute/debug an existing APK file with Eclipse

I have an existing .APK file without any sources. I want to debug it with Eclipse on Bluestacks (or other) emulator. Eventually, I'd like to set a breakpoint, but for now, I just want to get it to run on the emulator. I'm not talking about just using adb to install it on the emulator and then run there. I've been unsuccessful in getting the resulting .apk, built by Eclipse, to run on the emulator.
Here are the steps I've done:
I renamed the .apk to .zip and unzip into a folder.
In Eclipse, I created a new "Android project from existing code". In the next screen, "Import Projects", I browsed to the folder where the apk was unzipped.
But this project has errors in Eclipse! So I tried the next steps:
I executed apktool on the .apk, and it created a folder which I use for the same import
mentioned in step 2. Now the project no longer has errors.
In Eclipse, I "run as" or "debug as" this project as an Android application, and it starts on the emulator.
No good! The logcat shows errors such as "dalvikv - thread exiting with uncaught exception". And there are other logcat messages about being unable to instantiate application and java.lang.ClassNotFoundException.
QUESTION 1:
Can someone tell me what other steps are necessary to turn this into a "good" project? Is there something obvious that I'm missing about Classes?
Once I can get it to either "run as" or "debug as" successfully, then I will want to debug it by setting a breakpoint. But I can't seem to get the source folder right. I have .smali files as a result of the apktool step mentioned in step 3. Also, I've tried various tools, such as dex2jar and jd-gui, so that I have .java files. But whenever I point tell Eclipse the folder where these sources are (and I have "search subfolders" checked), Eclipse says "Source not found". And "Edit Source Lookup Path". I also tried putting the
sources in the /src folder of the workspace.
QUESTION 2:
Where can I put the sources so that Eclipse will find them? Can these source files be either .smali or .java?
So basically what you are trying to do is to extract the source out of a packaged APK file. What you have achieved is the max i could do as well. There's no way to get the exact and true source code due to obfuscations whilst packaging an APK file. So what you have reached to is the max you can get to. I used these tools but never could extract a true .java file as the author may have written. It will contain some compiler addtitons and optimizations which are not understood by eclipse.
Question 1: You will have many step to get android project from .apk file. This work is named reversing, decoding...
You can use apktool to decompile apk to .smali files
Then use javaDecompiler for reversing .smali files to .java files
Create project and import .java files into it
Question 2: Try question 1 you can do it.
Notice: if developer who coded that apk use proguard, you only see follow of code.

R.java doesn't exist...but it does! Problem started after installing ADT 10.0.0

I get this error when I try to clean a project:
ERROR: Unable to open class file ....R.java: No such file or directory
So I can't build my projects any more. But R.java is there in the gen folder and looks fine when I open it.
This happens to every one of my projects. I tried completely deleting the Eclipse folder and reinstalling it (Helios on Windows) and Android ADT. No luck.
I have also tried moving my workspace to a different drive. No luck.
I made sure all folders in my workspace are not read only. This worked the first time, but immediately the error came back when I cleaned my project.
This all started right after installing ADT 10.0. I am wondering if it somehow is building R.java as a read-only file.
EDIT: Is deleting the eclipse directory sufficient to reset all of its configuration?
More info: All my projects are fine, until I rebuild or clean them. Then every class that looks at R.java throws an error.
Did you try to remove "bin" and "gen" folders and after that make clean/build?
I have somehow managed to fix it, but I don't know exactly what did it. Here are things I did.
Deleted eclipse directory and reinstalled it and ADT.
Deleted my original project that was the first to have the problem.'
Created a new project with my original's project name.
Manually copied all my class and res files into the new project and refreshed it.
Pasted the text of the old manifest into the new manifest.
I did all this, because simply importing the original project again didn't solve anything.
After the above changes, my other projects still had the problem after pressing clean on them. But then I could fix those by deleting the Gen folder, and making sure the Java Build Path had all folders checked.
I think format C: and reinstalling windows
will be preferred way to solve this issue :)
now for serious that work for me
install all updates restart eclipse and close your project
restart eclipse and delete gen from eclipse and rebuild your project
if you're having the problem for all of your projects, it could be this:
"Debug certificate expired" error in Eclipse Android plugins
that's what fixed it for me, even though I wasn't getting any debug certificate errors. apparently the debug certificate is only valid for one year.
I found this issue reported for Mac:
But it's the same for Windows, and I guess, for Linux. I've posted there a workaround, very similar to the one by TenFour04, but without the need to reinstall anything:
Delete project from Eclipse;
Delete all project generated and configuration files and folders (bin, gen, .classpath, .project, default.properties);
Go to Eclipse and create a new Android Project (do not import an existing one) choosing your original source files;
Adjust all setting (JRE, libraries, linked files, aspects, etc...)
Clean.
Helo guys,
:) This my solution which work for me fine in eclipse.
First : You need to make a copy of the file who make the problem.
Second : delete this file from eclipse
Third : Project >clean
After you can restart your delted file from the location where you have saved it.
Have a nice day

invalid APK file

Hi i am new to android dev.
getting error ..
[2011-01-17 11:15:48 - TriviaGK] Installation failed due to invalid APK file!
[2011-01-17 11:15:48 - TriviaGK] Please check logcat output for more details.
[2011-01-17 11:15:48 - TriviaGK] Launch canceled!
plz tell where is logcat stored and how to debug this.
Also another app is running successfully in same enviroment.
Please Help android geeks.
I know this question was asked in January, but, did you try cleaning the build? I just got this issue and solved it by going to Project --> Clean... and then running that. It'll delete your APK's and then when you run they'll be rebuilt. Worked for me!
In Eclipse, go to Window->Open Perspective->Other and you should see DDMS as an option. If you choose this perspective LogCat is shown by default along with some other debug tools. If it does not show up, you can find it under Window->Show View->Other->Android->LogCat.
Check the default.properties file to see if the target-sdk (which version of android you want the app to be targeted to) and be sure that you actually got the sdk for that version of Android.
If you don't, either download the right SDK or change the target sdk in default properties.
For me the problem appeared to be that I made archive of the "www" folder - tar.gz one, for backup - on the same place where the "www" folder itself is - inside the "assets" folder. And that archive was causing the error.
All other projects were launching fine. And when I deleted this archive - the error was gone.
PS: when I made .zip archive of the "www" folder - and the project could run fine with no problems :D ... haha :D ...
Small chance that you have the same problem, but still:
After viewing the Logcat output I noticed that your Android project should not contain (or at least not start with) an underscore (_).
edit: As I see now, the console log you posted has your project name in it, and does not contain any underscores. So this answer won't solve your problem, but might still be usefull to others.
Zip aligning a file can also cause this issue. If you are having it, try uploading the signed APK file (prior to zipalign) to your device and see if the problem persists. If the problem hets fixed, then ZIPALIGNING it is not working properly.

Categories

Resources