Setting up OpenFrameworks with Android Studio - android

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.

Related

Android app not running after splash screen

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.

Starting Android Learning

Recently i've started android training, and i've got the below 2 issues.
In my desktop i already had eclipse installed, and when trying to import the android plugins, I was getting some error, so what i did was downloaded eclipse+android package from android developers website and I copied it onto my programs files folder where java is installed and when i open it, it is throwing me an error saying the javaw is not found, goinf through the earlier posts on SO website, i've tried the below.
-vm
\adding the java path
But this didn't work for me. so what i did was installed the same package in my laptop(there is no another eclipse on my laptop). and it started working fine.
On my laptop in the eclipse+android package i write a program and when i hit the Android virtual device manager, it asks me to create a AVD, and when i've filled the entire data here, the OK button is still greyed out. Below is the screenshot.
Also i've tried to create by creating from Device definition,even here i'm not getting the ok button hoghlighted and below is its screenshot
please let me know how can i fix the above issues.
Thanks
Firstly you need not wonder for such a mess ..
For IDE purpose .. go to this link .. https://developer.android.com/sdk/installing/studio.html
Android Studio IDE contains all you need .. Just download ..extract and start creating your first Android project.
And now for tutorials to learn .. try these site ..
(1) https://buckysroom.org/videos.php?cat=6 ( Travis ... provide best tutorial in this world )
(2) https://developer.android.com/index.html
Now you are good to go ..
You can see it clearly says: "CPU/ABI: No system images installed for this target"
So either:
Lower your target.
Update your SDK.
Then set a CPU and you can go on in the AVD creation process.
update the sdk, install ARM/intel(x86) for CPU/ABI
Try using Android Studio by IntelliJ ,as it is for more better than eclipse and moreover ADT plugin for Eclipse is no longer in active development.
if you then also get the same error again try this link android Developer and setup java environment.

Getting GoogleCast to work

I've tried, with zero success so far, to both create a new project and add GoogleCast to it and to get the given examples to work on Android Studio (currently using 0.3.2, but will upgrade if needed) on MacOSX.
Migrating to Eclipse, however, is not a valid option at this time.
I always seem to end up stuck with some reference issue, either giving me the error "No resource found that matches the given name '#style/Theme.AppCompat'." or multiple compile-time errors related to having no idea where android.support.v7 is located at.
Tried many different solutions, such as removing the #style part that someone mentioned to work or setting the v7 path as relative.
Though I wasn't able to follow through with this last one, no idea how to actively do that in AS and not enough reputation to comment there.
Then I came up to this solution Anyone get the chromecast android examples working in android studio?, which seems like a good attempt, except I can't seem to find the mentioned GoogleCastSdkAndroid.jar anywhere, so I'm stuck.
Couldn't find a truly comprehensive tutorial anywhere either, since they all seem to have no issues whatsoever adding v7 to the project.
Thanks in advance for anyone who can donate some of their time to solving this issue.
EDIT:
After upgrading to 0.4.6 (is 0.5.1 stable already? Considered how fast it came after 0.5.0...doesn't sound too good); I did what Ali Naddaf suggested, but couple extra questions popped up:
I could build the CastVideos project and import it into Studio with no problem; however, the CastVideos project structure is radically different from a new project's structure (referred to as OtherApp from now on).
The main issue that pops up when I try to mimic CastVideos on OtherApp is that it doesn't find the CastCompanionLibrary project on the OtherApp only, which I can't seem to be able to figure out where exactly should be located at (I thought the 'core' folder was the one with AndroidManifest?).
Also, how do you import modules now? The Project Structure only allows the creation of new modules.
My suggestions:
update your Android Studio
open SDK manager and make sure you have the "Android Support Repository" installed
create an empty directory on your system (referred to it as <DIR> below)
change directory to <DIR> and clone CastCompanionLibrary-android to CastConpanionLibrary
$ cd <DIR>
$ git clone https://github.com/googlecast/CastCompanionLibrary-android.git CastCompanionLibrary
$ git clone https://github.com/googlecast/CastVideos-android.git CastVideos
first make sure all is fine by building from command line:
$ cd CastVideos
$ ./gradlew build
it should do a successful build at this point.
if all is fine, open your Android Studio and select "Import Project" and point to build.gradle in the CastVideos project.
Now for any other project, you can look at the build.gradle in CastCompanionLibrary or CastVideos to see how you can set up your dependencies on the support libraries; if you don't have dependency on the CastCompnionLibrary, then it is even easier.
You very much need to upgrade Android Studio. 0.3.2 is quite old and a multitude of bugs have been fixed since then that are almost certainly affecting you.
Other than that, make sure you have the Android Support Repository installed in your SDK Manager. Between those two it should solve your support.v7 errors and #style/Theme.AppCompat issues.
This question is very old but to make it work I had to clone both Git repositories (CastCompanionLibrary & CastVideos-android). Import CCL into Android Studio as Non Android Studio Project, change the version of build tools to current 21.1.10, build the project and close it. Android Studio asked me to reopen the project. Hit yes. Do exactly the same with CastVideos-android and finally I could launch it into my smartphone.
Was really painful, took me 2 hours make sense of the error, because I was trying to open into Android Studio like Android Studio projects (they were) but there was a problem with the .idea file.
Tried this and everything worked.

Build Errors using Xamarin and Visual Studio 2012

I'm trying to get Visual Studio 2012 running on Windows 8 and using Xamarin.
My android sdk is installed and identified in Visual Studio 2012. Xamarin account is verified. I have administrator privileges on the PC.
When I try to build the generic Android Application (Hello World) that comes as a default template I get the following error:
Access to the path 'resources.apk.bk' is denied.
When I rebuild I get the above error plus
The directory is not empty.
I've search around for this a lot. I'm going to post to stackOverflow but thought you might be able to help.
In addition I get the following warnings:
Could not find schema information for the element 'manifest'.
Could not find schema information for the element 'uses-sdk'.
Could not find schema information for the element 'application'.
Trying to build good projects from my colleagues yield similar results.
Are you running an Anti-virus application? Most likely you are. When I first started using VS2012 I had similar issues. Our corporate developer installations separates a particular folder(s) from the anti-virus. Moving all project related files there solved the problem.
Right click the Project and click properties. Check the Compile using Android version it should be less or equal then your Android API version.

Eclipse crashes when I invoke Android Layout Editor

I'm new to Android & Eclipse. I've downloaded Eclipse and the Android ADT and created an ultra-simple Hello World app (has only auto-generated .java and .xml files).
Eclipse CRASHES (closes after a very brief pause) when I do the following:
In Package Explorer, select AppName/res/layout/main.xml
Press , or double-click, or 'Open With' then 'Android Layout Editor'
(The app runs OK in the Android emulator)
My configuration is:
Android Development Tools 0.9.5.v200911191123-20404 com.android.ide.eclipse.adt.feature.group
Eclipse IDE for Java Developers 1.2.2.20100216-1730 epp.package.java
Windows XP
Can someone tell me what I'm doing wrong or what's wrong with my configuration?
Any suggestions on what to check? For any non-trivial app development I need to
be able to use the Layout Editor.
More ... I can select main.xml and Right-Click and 'Open With' any of: XML Editor,
XML Schema Editor, Text Editor -- with no problem. The problem is limited to Android Layout Editor.
THANKS!
I found the problem.
I discovered the .log files (under \Android SDK\eclipse-java-galileo ...\eclipse )
These files are apparently created by Eclipse when a fatal exception occurs. Upon examining the latest file I saw
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d2521e1, pid=9156, tid=13952
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode)
# Problematic frame:
# C [fontmanager.dll+0x121e1]
and when I looked further, found the folder where fontmanager.dll resides.
Deducing that 'fontmanager.dll' was part of the Java runtime, I saw that I'd been using jre1.5.0_02, and, upon checking the Sun site, discovered that it's an outdated file. So I downloaded (from Sun site) and installed the latest version of the Java runtime.
That fixed it! The Android Layout Editor runs without problems.
THANKS to Nathan for his efforts. As it turned out, his suggestion didn't solve this particular problem, but the info he provided will no doubt be useful.
You have to upgrade your jdk version to the latest version. I found most of the cases online is that the jdk5 made the eclipse crashed and they worked out by upgrade to jdk6. I used jdk6 but the problem existed! At last I download the latest version(jdk7) and the eclipse not crashes any more!
DONT do anything in eclipse while it says "building project" at the bottom right it does this when you load eclipse, and when you run, or add new files.
If you still have the problem, then I cant help you
In case the above answers don't help, this was my resolve:
I had a similar problem where every time I would view the layout editor (even though I was able to see the XML file) Eclipse would crash. I reinstalled Java, updated Java, and I even reinstalled Eclipse with no avail. It turns out that it was a corrupt video driver, nvd3dum.dll. The filename is in the error list.

Categories

Resources