I have a perfectly working application on Android 4.4.4 Kitkat and below. When i run this application on a device with L-Preview, it crashes, giving me NullPointerException. So, inorder to test the application, i want to change the application's minSdkVersion to L, and run it on an emulator.
Important Note: There are no controls in the application that are specific to L-Preview. I am using Eclipse.
Here is what i have done till now...
Updated SDK and Support libraries to the latest versions.
Created an Emulator with Target as Android L.
Changed the Java Compiler settings for application to 1.7
In the application:
(i) In AndroidManifest.xml, changed minSdkVersion and targetSdkVersion to L.
android:minSdkVersion="L"
android:targetSdkVersion="L"
(ii) In Project Properties -> Android -> Project Build Target, checked Android L(Preview).
As soon as i make these changes, and building the application, there are erros in the application and gen folder becomes empty (Is there some issue with Layouts or Styles? Shoudl i be creating a values-v21 folder in layout and use a different theme? Material Theme? and also a drawable-v21?). When i change back the settings to Pre-L settings that are originally there in the application, everything gets back to normal.
What other changes should i be doing for this to work on a device with L. or Atleast get rid of errors and make this application start on the device with L? Most of the errors are because of R.java that goes missing from gen as soon as i make changes.
Not much we can specifically help with without a stack trace... but a recommendation would be to run the CheckJNI tool as Android L tightened up JNI compliance. It might or might not help you towards solving your problem but it could shed some light.
Here is info about how to run the tool: http://developer.android.com/training/articles/perf-jni.html#extended_checking
Related
I would like to contact you with the problem that I switched from Delphi version 10.4 to Alexandria (11.2).
From then on, my Android applications compile and build without error, but after the splash screen they do not start on Android devices, regardless of the Android version. Not even on those that ran without errors before.
I did not change the source code, only the development tool was updated.
Looking around the Internet, others are also complaining about this phenomenon, but I can't find a solution anywhere.
My respectful request would be that if you can suggest some kind of solution, please let me know, because this is why I am standing still and it would be good to move forward.
Thank you in advance for your answers.
Android system libraries have been reset to default.
There are a lot of possibilities. Here are a few steps you can use to troubleshoot this sort of failure.
Always back up your project first. Preferably using source control!
Revert Deployment
In the release notes for 11 Alexandria there is section about updates to the Android Manifest
An older Android Project Might Fail at Run Time or When Debugging
Building an older Android project in the IDE can cause the app to fail
at run time and debug time, with a Java "Class not found error". To
correct the issue, do the following:
Select Project > Deployment.
In the Deployment Manager, click the Revert To Default speed button.
It is the 7th button that looks kind of like "undo". Make sure you select the Android platform.
Test a New Project
Create a new simple project from scratch and see if it will run. Try both Android 32-bit and 64-bit. If it doesn't then there may be something wrong in your SDK Manager (Tools -> Options -> Deployment -> SDK Manager).
Look under Android on all three tabs: SDK, NDK, Java; for any warning symbols. You might need to correct a path or install Android support.
Compare AndroidManifest.template.xml
Take the AndroidManifest.template.xml from the new project you created, and compare it to the one in your project from a previous version. If you haven't modified it then you can just copy the new one over the old one.
Revert Android Libraries
Expand out the Project Manager and the Android platforms to Libraries. Right click and choose Revert System Files to Default.
More Debugging
You can use ADB LOGCAT to see the error on failure. This is super useful. There are GUI wrappers for it, like DeviceLens by Dave Nottage of DelphiWorlds.
Check the code in your form constructor. An exception here can cause a crash like you are describing.
Reboot your phone. I hate how often this fixes things for me. It should be the first thing, but it is usually the last.
I'm developing in Android Studio 3.0 when earlier today, it hit an IDE Error while I was trying to deploy code and it wasn't able to save my settings. It also said that I should reset the IDE.
After doing so, everything in the code is underlined red. The auto help suggested that I specify the JDK. After setting that, everything was fine and running again. I was able to run and compile my code and test it on a tablet.
However, when I closed and open Android Studio again, the error was back. After the fix mentioned above, I tried adding an activity to the project, and I got this:
Again, after hitting "Setup JDK" and specifying the JDK (Android API 19 Platform), the project was up and running.
I also noticed this when I opened other projects, I had to specify which JDK to use - and this is getting irritating.
Does anyone know where to setup the JDK for a project so that Android Studio won't ask me every time I open a project or add an activity? I can't find it thus far and Google hasn't been too helpful.
I was not able to find a solution for this and the things I tried didn't worked..
I have a Android Project in Eclipse ADT. I specified minSdkVersion="15 in the Manifest and I also set this Project to 4.0.3 from the beginning. My Layout displays perfectly in Eclipse but when I upload the App to my Device(s) (Android 4.3 and 4.2.2) it shows the pre-ICS buttons. See attached files..
On Eclipse it looks like this:
(Sorry I can't insert the pictures directly because as a new user I have no points)
On my device:
Any clue what the problem could be? I also checked the Project Properties and set the build target to Android 4.0.3 but without effect.
Make sure you also use targetSdkVersion parameter to target the latest SDK
Do you check the Theme of the actives in manifest?
Read about also in: http://developer.android.com/guide/topics/ui/themes.html#SelectATheme
I am trying to create an Android Application Project, but I have had a number of problems. As it is now, I cannot get beyond the first dialog box. Here is the screenshot:
I am also reading that I have every sdk up to Android 4.1, even though I only have android 4.2, as shown in the following screenshots:
Additionally, when I open the android developer tools program, the following dialog box comes up:
even though, I have the Android Developer Toolkit version 21.1.0 installed on my machine, as shown by the following screen shot:
I am very confused right now. Could somebody please help me solve these problems? Would really appreciate it.
Holo Light Theme cannot be applied to Android 2.2. You need at least a minimum sdk of Android 3.
So either don't use Holo Theme or set you minimum to Android 3.
Edit: You may look into this instead: Update Android SDK Tool to 22.0.4(Latest Version) from 22.0.1
I am using robotium tool in eclipse to create test cases.
My doubt is every time i make any changes in any of the file i get error like
Call requires API level 3 (current min is 1)... Android Lint Problem
and when i do right click on project and then android tools->clear lint markers
all those errors goes.But i am not getting why such lint errors comes on making any changes in the file?What is the reason for these lint errors.
You are using functionalities only available in newer API-levels than is your set minimum in android manifest file.
If you set <uses-sdk android:minSdkVersion="1" /> , you should not use any classes that were introduced in API-level 3.
I was having the same issue with Robotium and the lint markers. Instead of modifying any manifest files, I suggest disabling the minSDK lint check for your project that is using Robotium.
"Clear Lint Markers" removed the error temporarily, but it kept coming back every time I saved a file in the affected project.
Here's what worked for me:
Right click project -> Properties -> Android Lint Preferences
Search for "minSdk" in the search box
Click on "UsesMinSdkAttributes"
Click the "Ignore All" button at the bottom. Clean and rebuild the
project, and Eclipse/ADT will no longer run the lint check for minSdk
on your project.
Please refer this link. As it says,
Android Lint is a new tool introduced in ADT 16 (and Tools 16) which scans Android project sources for potential bugs. It is available both as a command line tool, as well as integrated with Eclipse (described below), and IntelliJ (details). The architecture is deliberately IDE independent so it will hopefully be integrated with other IDEs, with other build tools and with continuous integration systems as well.