I'm developing a project with android studio for a ODROID XU4 board. Because of the nature of the project I'm using android studio to make a native app in order to use some of the Harware features of the board as Ethernet, GPIO,... and because there is no intention of developing this for any other platform.
The problem now is that the customer wants a nice looking ionic interface.
I've been testing most of the approaches I found in google, ionic forums, stack overflow and many others sites but without success.
The nearest I've got is creating an ionic app, adding android platform and importing it to android studio.
My first question is:
1- Is this the correct approach?
My work flow is:
ionic start myapp
ionic platform add android
ionic build android
and then I import the myapp folder with android studio.
first of all I get an android studio error:
19:40:40 Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
More Information about migrating to Gradle
Don't show this message again.
19:40:41 Update Property Files
The structure of following Android modules was changed:
android
CordovaLib
Would you like to update related project.properties files?
Only once
Always for these modules
Never for these modules
19:40:44 Update Property Files
The structure of following Android modules was changed:
android
Would you like to update related project.properties files?
Only once
Always for these modules
Never for these modules
19:40:45 IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
19:48:09 Error Report: Submitted
Now its time to migrate the project to gradle:
here is the main problem, I don't know where to put the new gradle file or how to continue.
thanks.
First off: Your looking in the right direction. This is the correct approach. However, I think your problem is based on the fact that you importing the wrong folder to Android Studio.
Please import the folder "android" that is generated by ionic (cordova) in your myApp/platforms folder.
The recent Versions of cordova are using the Gradle build system. So if generated with a recent version of cordova the gradle build configuration files are already existing in that "android" folder.
By importing the myapp folder (as you did) these files are not present in your Android Studio projekt. Hence you see the error: This project does not use the Gradle build system.
Related
I imported FireBases Database Unity Package today and as part of the import it had to various upgrades (such as a .NET upgrade and installation of some Android packages.
My game builds and runs fine in the Unity editor, however trying to build the game for Android I get the following error.
I was fully able to build the game prior to importing the package.
After some looking around about this issue I found this bug on the Unity page: https://issuetracker.unity3d.com/issues/unity-tries-to-find-a-not-existing-classes-dot-jar-file-in-play-services-dot-aar-which-results-in-failing-android-build
However I am no closer as to saving this issue.
I am using the latest version of Unity 2017.3.1f1
After looking around I was able to find an answer.
Setting the build settings to Gradle and adding a Build.Gradle file in the root of the project was able to solve my issue.
This question was a duplicate of the following:
(Firebase Databse in Unity) missing classes.jar in Temp during build for Android
I have an android project that I can import to android studio. It opens but refuses to run. The file contains 4 folders (.idea, gen, java, res) and 2 files (AndroidManifest.xml and project.apk). I can't seem to run the app. When I import it, Android studio tells me "This project does not use the Gradle and migrate project to gradle.
Yes, Gradle is required for apps developed in or migrated to Android studio.
Android Studio’s build system is based on Gradle and uses build
configuration files written in Groovy syntax for ease of extensibility
and customization.
Since the whole build system is based on Gradle, you're stuck using it! Not a bad thing, Gradle is pretty great.
I have migrated quite a few projects to Android studio, for the most part it has been quick and painless.
There's a nice guide to help you migrate to Android Studio over at the Android development site: https://developer.android.com/studio/intro/migrate.html
I just started an android project for school, and I have to edit an android application that was built by previous students. I was given source files and apk but no gradle.
I imported into Android Studio and tried to run the build when I saw that I couldn't. I have looked up documentation online for the past 4 days and have so far come up with nothing other than downloading the gradle-2.7 files and running:
build gradle
in my computers shell.
Is there an easy way to build a gradle? Perhaps some tools or such? Or will I have to go through the files and write all the gradles myself?
Android Studio uses a Gradle wrapper to fully integrate the Android plugin for Gradle. You can build your Android apps from within Android Studio and from the command line on your machine or on machines where Android Studio is not installed.
Android studio comes bundled with gradle and in the screenshot I can see gradel folder, gradlew and gradlew.bat and build.gradle files. So (hopefully) all you need to take care is build.gradle files.
I would strongly suggest you to go through link
If you have time go through this course
I'm trying to create a hybrid application through the IONIC framework which displays multiple moving graphics implemented through HTML5 Canvas and JS. But, the animation renders very slowly in mobiles (even those with 1GB RAM).
We have identified and downloaded FastCanvas (Cordova/PhoneGap plugin). We followed the instructions given in the URL - https://github.com/phonegap/phonegap-plugin-fast-canvas. But under "Adding FastCanvas to Your Application" we hit a roadblock when we come to instructions 3 and 4 as there are no Java folders in my project.
The example (HTML5 Game) given in the url is done through PhoneGap which has the mentioned folder structure and it works fine when we build through Android studio.
We have tried to build our project (done through ionic framework) through Android Studio but, gradle build system was unable to identify the framework. Request someone to please guide me further to solve this issue since, I'm struggling to come up with a solution for long.
Note: We have already tried Canvas, JS, CSS3 and wizCanvas plugin for the animation but, the output is same - slow.
Whoo-hoo.
After a long struggle, this is what finally worked for me:
Opening a Project in Android Studio
Cordova for Android projects can be opened in the Android IDE, Android Studio. This can be useful if you wish to use Android Studio's built in Android debugging/profiling tools or if you are developing Android plugins. Please note that when opening your project in Android studio, it is recommended that you do NOT edit your code in the IDE. This will edit the code in the platforms folder of your project (not www), and changes are liable to be overwritten. Instead, edit the www folder and copy over your changes by running cordova build.
Plugin developers wishing to edit their native code in the IDE should use the --link flag when adding their plugin to the project via cordova plugin add. This will link the files so that changes to the plugin files in the platforms folder are reflected in your plugin's source folder (and vice versa).
To open a Cordova for Android project in Android Studio:
Launch Android Studio.
Select Import Project (Eclipse ADT, Gradle, etc).
Select the Android platform directory in your project (/platforms/android).
For the Gradle Sync question you can simply answer Yes.
(If prompted to update gradle from v2.3 to 3.3. click Update)
Once it finishes importing, you should be able to build and run the app directly from Android Studio. See Android Studio Overview and Building and Running from Android Studio for more details.
Refs:
https://cordova.apache.org/docs/en/latest/guide/platforms/android/
https://www.codeproject.com/articles/1068176/step-by-step-guide-to-build-ionic-hybrid-app-using
I'm having some issues with the new phonegap installation, using nodejs. I've managed to get everything working, set the path to ant, android sdk, java jdk etc., everything works perfectly.
With the usage of the following commands I've managed to create a new project:
cordova create hello com.example.hello HelloWorld
However, when I've examined the project, it was empty:
So I went into the "hello" folder and added an Android platform in the following manner:
cordova platform add android
and then I've build it:
cordova build android
So, after that, there were some android specific folders, as shown below:
Is this how the structure is suppose to look like? I'm having REAL problems importing this into Android Studio. However, I managed to import the project into eclipse, but now I have two projects, first is named "HelloWorld" and the other "HelloWorldCordovaLib". This is a bit confusing. While it works, why are there two projects? Am I doing something wrong?
Moreover, when I import this project into android studio, I get a bunch of errors (whereas the same project works in eclipse): Errors with the structure
This is seems very, very confusing. I have yet to understand why Phonegap is suddenly so hard to install. I hope I'm missing something. Any kind of feedback is welcome. Thanks.
Android Studio, amazingly, can't import Android projects that don't have the Gradle project structure. Until Cordova starts generating Gradle files, or Android Studio completes the importer's types of projects it'll support, you have to export the project from Eclipse before you can import it in to Android Studio.
It's perfectly valid to have two Projects in one Cordova application. Usually, it's because your app references the Cordova project as a sort of "sub-project" (not the right term, but I'm not sure what Android calls it).
The structure is correct.
when giving the command cordova platform add android you are actually adding a folder named android inside platform folder. For android development you have to work on the files inside platforms/android.
Read more here Phonegap - Command line interface