I am doing Tutorial 3
I downloaded the latest Android Studio v2.1.2
When I export a simple GUI App with the modifications as explained in the tutorial I am getting the following errors:
Resolve Error
Unable to find method
‘org.gradle.api.Project.getPluginManager()Lorg/gradle/api/plugins/PluginManager;’.
AND
Cannot open project
‘/Users/anthonybonello/Documents/Programming/JUCE_coding/GuiApp4Android/Builds/AndroidStudio’
I tried to change the Minimum SDK (I downloaded all back to 14)
Had to reduce the Gradle Version currently set at 1.8 . Android Studio is saying that it works with anything between 1.8 and 1.11 (Not as the default of Producer - if I remember well it was 2.x)
It is also having issues with the grade-experimental wrapper version 0.7.0-rc1
I also tried to download more Gradle-related plugins (in particular gradle-intellij-plugin wizard refuses to work as it requires DevKit - Have not located the following yet)
A related issue - Android Studio says:
Consult IDE log for more details (Help|Show Log) for errors above
and the link to Show the log does not work. Anyone knows where they are stored on a MacOSX?
Can you build it with gradle directly? To try this you need to copy the gradle wrapper script into your JUCE’s Build/AndroidStudio folder. To do this execute the following commands (assuming Android Studio is located in the Applications folder):
I had to manually create gradel/wrapper in my home folder as the third command line was complaining of not finding the folder. [I also notice that there is a gradlew file in my home directory.]
After this, the code worked and the following is the error produced:
Exception in thread “main” java.lang.RuntimeException: Wrapper properties file ‘/Users/anthonybonello/gradle/wrapper/gradle-wrapper.properties’ does not exist.
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:45)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:60)
I think you’ve set this up wrongly. Open your jucer file in the Projucer - make sure to delete the Builds and JuceLibraryCode folders first. Then do File -> Save Project. Let’s say your jucer file is at /Users/juce/Development/AndroidApp/AndroidApp.jucer Then open a terminal and do the following:
cd /Users/juce/Development/AndroidApp/Builds/AndroidStudio
The Projucer will have already created a gradle folder for you. Type-in
ls gradle/wrapper/*
You should see
gradle/wrapper/gradle-wrapper.properties
Note that it is gradle and not gradel (you typed gradel above). Now execute the commands I listed above:
I added the .txt extension because otherwise it will not allow me to upload the files.
I also uploaded the other two files just in case they show anything useful (same applies for extensions).
Ahh ok that’s odd. The Projucer does not seem to detect the correct gradle plugin version. Open the .jucer file in the projucer and change gradle-version to 2.11 and gradle-experimental wrapper version to 0.8.0-alpha6:
Googling the error says you might have the wrong build tools version. Can you now try importing the AndroidStudio folder into Android Studio. There is a chance that Android Studio will sort it out.
I restarted a new project (always following the JUCE Android Tutorial).
I tried the normal way of sending the project from Producer to Android Studio - it does not work.
I tried the import project in Android Studio
Option: Import project from external model - says Gradle location incorrect. Tried to redirect to the gradle/wrapper - still says incorrect location
Option: Create project from existing source - The following Error message comes up:
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.
Although it does open the source code.
I am not sure if the problem is on the projucer side - I saw that there were other tutorial which had problems (ex. the zip file download for tutorial “The application Window”
or whether the problem lies on Android Studio’s side.
I was thinking of uninstalling Android Studio and start again but a quick google search shows that there is no straight forward way of uninstalling, requiring to manually removing a lot of files from various places.
Re tools: I did find references to this on google. I am not sure what it refers to as I have downloaded all the SDKs from Android 4 up. I downloaded NDK. See image below
After having saved the project in the Projucer (with the gradle version/gradle-experiement wrapper version above), open Android studio, close all open projects and then select “Import Project (Eclipse, ADT, Gradle, etc.)”. Then select the AndroidStudio folder of your juce project. So, if your jucer file is located in Documents/MyAndroidProject/MyAndroidProject.jucer then you need to select the folder Documents/MyAndroidProject/Builds/AndroidStudio.
Error:Gradle version 2.11 is required. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in /Users/anthonybonello/Documents/Programming/JUCE_coding/AndroidPlugin02/Builds/AndroidStudio/gradle/wrapper/gradle-wrapper.properties to gradle-2.11-all.zip.
Please note I removed the SDK 24 (The N version) It was included in various errors previously.
[[[ I installed Android Studio on my Windows Desktop but I am having trouble getting to work there. I am glad that according to the developers of this Android Studio this is an easier way to work compared to Eclipse based setup. I wonder how their more difficult IDE would be like. ]]]]
I arrived at the stage where I can start a new project in Android Studio. I can load it in a Virtual device without errors. I can do modifications to the GUI and reload it. It works.
When I try to import the project from Projucer I am getting the following error:
Error:Cause: com/android/build/gradle/internal/model/DefaultAndroidProject : Unsupported major.minor version 52.0
Any ideas?
Cheers.
PS I can send images of all the settings I have in Android Studio.
This has been solved. I hope the following may be useful to others.
The settings I have are the following
Min SDK 14
gradle version 2.10
gradle-experimental wrapper version 0.7.0-rc1
Android build tools version 24.0.1
Architectures armeabi armeabi-v7a x86
With these settings I managed to get the project open in Android Studio and runs on
AVD using arm but had problems with x86. [ see Error at the bottom of this post]
I also managed to get it to run on my Samsung Galaxy J3
I can either send it directly from Producer, or
using Import project in Android Studio. Please note, The directory needs to point to
YourProjucerProject/Builds/AndroidStudio.
One thing that I believe was crucial in making this to work was the removal of the Android 6.X(N) SDK.
(For completness, I am running on MacOSX 10.10.3)
[Error when trying to use the x86 AVD]
07/28 16:51:36: Launching app
The currently selected variant “armeabi-v7a-debug” uses split APKs, but none of the 1 split apks are compatible with the current device with density “420” and ABIs “x86”.
Error while Installing APK