Android app not running after splash screen - android

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.

Related

Cannot use old NDK (android-ndk-r17c) after Catalina upgrade due to new security

After upgrading to macOS Catalina, my project won't build anymore. This is due to Catalina believing the binaries in 'android-ndk-r17c' to not be from a trusted developer.
You get messages such as:
"“ld” cannot be opened because the developer cannot be verified."
"macOS cannot verify that this app is free from malware"
I have to use the old NDK due to problems with native openCV library SDK and newer NDKs. They are working on it, but the newer SDK is not stable enough for me yet.
I was able to get around "clang" and "clang++" not being able to work by going to the security pane and clicking "Allow Anyway" on the security alerts. However, when trying this with "Id", I can get past the first warning by clicking "Allow Anyway" but it seems to be called subsequently and on the subsequent call I do not have the option to allow it to open.
There is no code really. I just have (and have had for a long time) Android Studio NDK reference pointing to the old NDK via the config.
In IDE from NDK, it fails to load "Id":
"“ld” cannot be opened because the developer cannot be verified."
"macOS cannot verify that this app is free from malware"
I just found the solution.
It's a tedious process but:
MacOS: Open up System Preferences
MacOS: Go to Security & Privacy (keep this one open, you'll need it for the entire process)
Unity: Go and build your project. When the error appears click "Cancel"
MacOS: In the Security & Privacy window - go and click "Allow" near the "clang" error - so that the MacOS system will recognize the app and utilise it.
The error will appear again, but this time will ask you to "Open" it. Click "Open"
The build will fail several times due to various dependencies, but it will fail with different files that you will need to allow as in the previous steps.
Build again your project.
If it fails, do the steps again, until it stops failing. Every single error you get with the file not being recognized will be different each time
There is a better way to work it around now.
You could got to Security & Privacy, open Developer Tools and add your terminal app to the list of the tools. The same could be done for your IDE.
To allow apps downloaded from Anywhere on MacOs Catalana do this:
sudo spctl --master-disable
I'd like to add to Mudassar Ashraf's answer.
If you don't see «Allow» option after clicking «Cancel», switch «Allow apps downloaded from» in Security window to «App Store and identified developers». This somehow will make «Allow» button appear. Then switch it back to «Anywhere». Repeat if necessary.
If by some reason in your Security & Privacy window button allow doesnt appear then just move your ndk to different directory and try whole process again.
Find your clang++ program inside the ndk directory (ndkpath/toolchains/llvm/prebuilt/darwin-x86_64/bin/) then right click and open
The solution is mentioned above. go to Terminal and run this code to allow apps from "Anywhere" and in security make sure "Anywhere" is selected. This will prevent from asking you 100 times if you want to allow xxx file downloaded from xxx as well as multiple build failures.
sudo spctl --master-disable

Setting up OpenFrameworks with Android Studio

I'm in the process of setting up my system to deploy OpenFrameworks apps on Android devices.
I've followed the instructions here to the letter: http://openframeworks.cc/setup/android-studio/
However, whenever I open one of the OF - Android example projects, I keep getting the following error:
I haven't turned up anything yet as far as what the issue may be (and this is my first foray to Android anything). Anyone have an idea?
It could be because there are some spaces in your directory path in "Development Tools" and "3rd Party Tools". I've had weird issues in the past with openFrameworks and Android studio like the one you're having.
Try to put openFrameworks in a path structure without spaces. Maybe clone a fresh version to test.

Android framework debugging in Eclipse

I'm working on a project where I'm making changes to the android framework sources. What's the best approach to do this in Eclipse and be able to debug? I've seen posts to attach the android source in Eclipse,but that's the 'standard' source code, not my own version.
At the moment I just make changes to the framework in a text-editor and build via commandline every time, run the emulator from commandline and start a adb logcat session to see if there aren't any exceptions, but there's got to be another (more productive/workable) way to do this?
There is an explanation how to attach debugger in the official documentation that you can find here. In my case the steps differ (Eclipse 3.7.2 and the last android tools):
Run > Debug Configurations...
Right-click "Remote Java Application", select "New".
Pick a name, i.e. "android-debug" or anything you like.
Set the "Project" to your android project name.
Keep the Host set to "localhost", but change Port to 8700.
Click the "Debug" button and you should be all set.
Then go to DDMS perspective and select a process you want to debug
(select the process in the list of processes and then click on green
bug icon). If you want to test your service, I think that it is a
part of system_server process.
Now you can switch to debug perspective.
As it is claimed in the documentation:
Once you do, you should see a list of threads; if you select one and
break it (by clicking the "pause" icon), it should show the stack
trace, source file, and line where execution is at. Breakpoints and
whatnot should all work.
What worked for me is using eclipse to edit/browse AOSP code, but use terminal for building AOSP code. Please check Debugging Android framework services. This blog explains how to setup your eclipse project that doesn't break AOSP builds and then debug using that project. Pretty similar to what the previous answer described, but uses a shadow folder so that eclipse build artifacts don't break AOSP build.

Android: Eclipse doesn't pushed new version of app to emulator

When developing for Android in Eclipse, the emulator relaunches the old version of the app each time I run the project unless I go through the rather arduous procedure of Settings -> Applications -> Manage applications -> [my application] -> Uninstall -> Ok -> Ok in the emulator.
I had this problem on some projects but not on others when following the tutorials on the Android Developers site, and my friend turns out to have the same problem. Although this has been asked before (here and to some extent here) their problem turned out to be "some extra quotes on one of the xml file" and I can see no such thing in my project. Otherwise people seems to be saying that Eclipse should push the new version. Unfortunately, it doesn't.
I would be grateful for any suggestions.
I had this issue as well, and what i figured out was:
If you are using your device for debugging, then you should launch a debug session, not a run one.
On the other hand, if you want to install an application, or you want to launch a run session directly on your device, the version of your application set in the androidManifest.xml must be greater than the one on your phone.
Try Menu-Project-Clean, Select your project to clean, this will delete everything but the source. Eclipse should re-build automagically if not select Menu-Project-Build Automatically.
Right click your project, Android tools, fix project should automatically fix some unknown error maybe
Double check your xml, an error in a layout could cause your situation. A wrong id for example will not show as an error in eclipse.

Huh? Android Preferences page refuses to load after adding SDK 1.6

This one is really weird. I had a perfectly working Eclipse + Android 2.2 SDK working in both Administrator account and LUA (Limited User Account) under Windows XP.
Then I decided to add the Android 1.6 SDK (I could do it from an Administrator account only). It seemed to have gone well, since it still works perfectly -- but only in that Administrator account!
When I try to start Eclipse under a LUA, I receive the following error message box:
Which disappears within 2-3 seconds and replaced with:
I then tried to check the Preferences page, but again, all I receive is error messages:
and:
Any idea why this is happening and how to fix this?
(I would love to be able to continue working from a LUA)
Update: I have uploaded the error log file (referred to in the "Show Error Log" in the message boxes), for your expert examination. Hopefully this can shed some light on the mystery.
The full answer is somewhat complex, concerning Eclipse's configuration area, the workspace area, etc. This is all documented on the Eclipse site, if you're interested.
But there's a simpler, more immediate approach, since you're not trying to run multiple users simultaneously on the same copy, over a network -- in which case you'd need the full answer.
Simply install Eclipse in a directory, say, C:/dev/Eclipse. Make sure both your limited user and your admin have write access to everything. Run Eclipse as the limited user. It should start right up, as there's nothing privileged that is needed by Eclipse.
At this point, you can lock it down as read-only if you desire. By default, all the configuration is stored within the Eclipse installation directory.
I'd suggest starting with a fresh install at this point, to eliminate any inconsistencies that you may have introduced. Though you should be able to reset things by deleting all the subdirectories of the configure/ directory (but not the config.ini). There's an official way to do that, but that's part of the full answer. :=)
I'd also suggest using a different workspace for each user, to avoid any permissions problems.
But my BIG suggestion is -- upgrade to Windows 7, and do NOT run Eclipse as an administrator!
Anyway, once you have it working -- to upgrade in the future, make the Eclipse directory completely writable by the limited user, and then update as the limited user, and then make it read-only again if needed.
Note: This is the cheating way. The REAL answer is to give each user their own configuration directory. This is only viable because you have control over both users and can coordinate any updates.
Try running eclipse by downloading the binary and unzipping and directly running the .exe rather than "installing" it. The android tools should work this way if you configure the appropriate paths to them, and if eclipse isn't "installed" but simply run from a the archive folder, it should try to download plugins and such into its own directory (owned by your user), which may solve your problem.
I doubt the Android developers who built the tools run under LUAs, so they probably didn't run into this problem...
Workaround found: Run Eclipse as Administrator (Right-click exe/shortcut, then select "Run as...", then enter Administrator's password).
This is a workaround, not a solution, but it does allow me to continue working while logged in LUA.
Thanks to #David who suggested this solution here: Android ADT Plugin doesn't show up in Eclipse
Update: Solution found:
Enable the Security tab in Windows XP Pro (""Use Simple File Sharing.")
Add the LUA account to C:\eclipse with Modify permissions.
That's it. No need to run Eclipse via "Run as". Also eliminates the need for a fresh install (which takes more time).

Categories

Resources