How can I fix Project “MyApp” Is not a gradle based project - android

I’m doing some work on an existing flutter project which I have Imported into Android Studio. I’m receiving the below error when I’m trying sync the project after editing the gradle when connecting the project to Firebase.
I have edited the project and app level gradles as per the firebase instructions but get the below error.
Project “MyApp” Is not a gradle based project.
Just wondering how I can fix this?
Thanks

Your project mightnot complied with gradle. I suggest you only copy xml code and java class code into Android studio but at first creat a mainActivity into Android studio.Hope it will works.

Related

Not able to add dependency to android project in flutter

Hello I am new to flutter and i want to do native function calls using flutter, i wrote an sample native code app and it is working as expected. Now i want to use some packages on my android code, which is platform specific.
I have added my dependcies in my build.gradle file and it the gradle build is success,
But i cannot use the package there,
say for example: i have added the dependency for the com.squareup.okhttp3:okhttp:3.4.2 and gradle build is success and now icannot access their methods and other stuffs. Please let me know to what to do with it. Thanks in advance.enter image description here
Finally it worked, i opened the android project as an new android project in android studio which resolved the issue.

How do I add in a class created in a different android project?

Please forgive the vague sounding title
I am trying to get this project to compile in android studio:
https://proandroiddev.com/how-to-create-a-bubble-selection-animation-on-android-627044da4854
https://github.com/igalata/Bubble-Picker
Downloading the github project and compiling it as it is did not work, I am getting this error, and redownloading dependencies and syncing as suggested in the error message did not work
UPDATE: I have upgraded android studio, gradle and kotlin plugin to latest version and it's still the same problem.
I can use the library version of this project just fine, using the steps described in the github page. I want to compile the source code of this component together with my project so that I can tweak the bubble animation itself. Since the github project itself does not compile, I created a Hello World project first, then manually copied in the bubblepicker folder in the Hello World project. Inside the bubblepicker folder, I changed the name of the folder tree java/com/iglata/bubblepicker to java/com/test/app/bubblepicker, and changed the package name of the files inside this folder to reflect this. I then copied the code in DemoActivity.kt to my MainActivity.kt and changed the package names and made few minor adjustments to make the compiler errors go away.
I have made some modifications in the gradle files as well so that gradle syncing does not give any errors. However, anything inside bubblepicker does not seem to be detected in the MainActivity.kt, or it's activity layout xml file. For example,
import com.test.app.bubblepicker.BubblePickerListener
is marked with red colour in android studio and the error is unresolved reference. If I remove all references to bubblepicker and replace the code in MainActivity.kt with the Hello World code, then it compiles and runs fine, so it's as if bubblepicker is not getting picked up by the compiler at all.
What could be the problem here?
Or at the very least, how can I compile the bubblepicker github project? Simply loading the whole project in Android Studio is giving me compiler errors. I am doing this on Android Studio 3.5 on macOS with Kotlin version latest as of September 4.
I didn't get any error while import Github project.
Kindly update your android studio and kotlin Gradle version and check same.

Error MSB4044 - Getting this error when building Xamarin android project

Error MSB4044: The "ResolveLibraryProjectImports" task was not given a value for the required parameter "DesignTimeBuild"- From visual studio for Mac
Tried cleaning the project and and removed all the obj files.
Any help appreciated.
Thank you
Clean your Project and Build individual Components like right click on your common/Droid/iOs individually and click build,instead of doing build all,see if this works
1.) Check in your Build - Configuration manager that iOS project is not selected while Droid project is being build.
Or
2.) Check the packages version that you have installed are compatible, i.e Xamarin.Forms package version should be compatible with Droid other packages and version should be same for your PCL project.
Hope this may solve your issue.
when I replaced the file with another in the Android.coomon.targets, this error was fixed and the project got build successfully.

How to Configure AspectJ in Android Studio

I am trying to configure AspectJ in Android Studio. But after all trial and error its not working ! Surprisingly I am able to make it work with Eclipse Kepler version The steps I followed for Android Studio
Created sample Android Project
File > Settings > searched for AspectJ in Plugin section
Assuming nothing more to be done in Studio , except configuration of build.gradle files
Added compile 'org.aspectj:aspectjrt:1.8.1' to the to the build.gradle (Module:app)
Created Analytics_onBackPressed.aj for back button press detection
Created Analytics_OnClick.aj for click events detection
Created Analytics_onCreate.aj for components oncreate event detection
Created necessary dependency classes which the above mentioned *.aj classes will internally call
Added required permissions in Manifest
Running the project is not detecting any of the events (button click, oncreate or back button click)
Followed these links ReferenceLinkOne , ReferenceLinkTwo and ReferenceLinkThree
My Question is what is more required to make AspectJ working with Android Studio
Steps followed in Eclipse and got AspectJ working
Downloaded Eclipse Kepler version
Through Install New Software option searched for http://download.eclipse.org/tools/ajdt/43/update
Installed AspectJ Development Tools (Required) .
Created sample android project
Created Analytics_onBackPressed.aj for back button press detection
Created Analytics_OnClick.aj for click events detection
Created Analytics_onCreate.aj for components oncreate event detection
Added required permissions in Manifest File
Right clicked in project and converted project to AspectJ by the following
Configured Java build path with AspectJ runtime library
Now while running the project, I am able to detect components oncreate, back button press
Environment Used
Android Studio : 2.1.2
JRE : 1.8.0
Windows 7 Enterprise
Any help is highly appreciated!
EDIT : 1 , From the output , still AspectJ is not properly configured
As per this link , I created jar file from eclipse including *.aj files and corresponding dependency. Excluded AndroidManifest.xml while creating jar file and created jar
Created Project in Android Studio. Placed this *.jar file in libs file. (apps> libs). I have enabled AspectJ waving as shown below
Now searched the properties for AspectJ and enabled
Now running the project, should be creating logs I had put in *.aj files which is in plugin . Unfortunately these logs are not printed in Android Studio logs.
Form which I am concluding still AspectJ is not enabled in this project OR there is a configuration error
Disclosure: I am the author of the inofficial AspectJ weaver plugin.
As noted in the AspectJ weaver plugin documentation, the plugin does not support compiling .aj files.
To use this plugin, you have two options:
Switch from .aj to annotation style aspects.
Compile the .aj files outside the IDE (IntelliJ Community / Android Studio), for example using Maven/Gradle/Ant, and package them into a .jar. Include this .jar as a dependency in your project and click the Search for aspects... button, as per the documentation.
I have had various success trying to get AspectJ working in Android Studio. This link helped me get part of the way there (assumes Gradle build setup for your project). http://fernandocejas.com/2014/08/03/aspect-oriented-programming-in-android/
Using the custom block of code in the build.gradle file, I was able to get aspects defined using annotations in .java files compiling and weaving properly in my project. However, this same method did not work for me when defining native aspects using .aj files. I hope it helps.
IntelliJ has no tooling support for AspectJ, and Annotation Style AspectJ can work on Android studio. Just treat the aspect code as Java code.
For detail read this issue
aspectj for Android studio - where is AJDT plugin
Also, you can use gradle plugin aspectjx which can weave kotlin code and demo is here

Android Error :trouble writing output: already prepared

I imported a project from other's workspace running succusfully there in Api 21 .There is no error in code after importing it in mine but as i run the project in eclipse after updating it to android SDK 21 it shows trouble writing output: already prepared .There may be some problem in configuration .console please help me to fix this problem.
This is not about configuration, it´s about old files...
Clean Project
Refresh Project
Build Project.
Run

Categories

Resources