Can't build in Android Studio


#1

Hi all,

I read Timur's post and a couple of others about the problems coming up with Android Studio while trying to build a simple project.
The project compiles fine on both Xcode and Visual Studio 2013 for Mac OS X and Windows 10 respectively, but cannot build for Android!

I updated to Android Studio 2.1, downloaded the latest NDK etc..

I get the same error running AS on both Mac and Win "Error:(1, 0) Plugin with id 'com.android.model.application' not found."

What I have done is to change the dependecies in the build.gradle to: dependencies { classpath 'com.android.tools.build:gradle:2.1.0-alpha1' } as Android Studio promted me to do,
and also in the gradle-wrapper.properties I tried changing the distributionUrl to the latest "gradle-2.12-all.zip".

What does that mean? I have no experience with AS, what should I look for?

Thanks in advance,
Nikolas
 


#2

Hi,

For JUCE projects, never change any build settings in Android Studio if it prompts you to, this will often completely break the project (this seems to have happened to you). Instead, manage all your build settings in Introjucer. Then, re-save the project in Introjucer, and re-import it in Android Studio.

Please try re-saving and re-importing, and not clicking anything in Android Studio afterwards (just ignore all warnings). Hope this works.


#3

Hi Timur,

I resaved from the Projucer and reimported the project to Android Studio, but now it stucks here:

$$JuceAndroidRuntimePermissionsCode$$ // If you get an error here, you need to re-save your project with the introjucer!

I re-save the project and try again, and it again stucks there. Any idea on what could be wrong?
The same behaviour goes on both my Mac and Win PC.
 


#4

Yes. Before you re-save, you need to re-compile the Introjucer itself (using the newest tip of JUCE from github) and then re-save your project with that new Introjucer.


#5

That is exactly what I did!

According to this thread: http://www.juce.com/forum/topic/android-activity-class-names-underscores-and-hair-loss
you should not have an undescore on the project name because it causes a fatal error when building your app, which I experienced.
No underscore and everything was fine.

Also this worked fine on Windows 10 for me.

Thank you Timur fot the help.
Have a great week!

Nick.


#6

OK, good to know. I'll add this info to the "Android Issues" sticky post. Thanks!