I created flutter project before androidx releasing. App always give warning message Your app isn't using AndroidX, but i migrated app to androidx with applying all steps. I tried every method, but does not work. I opened android part of flutter project in android studio and then migrate androidx, i added android.useAndroidX=true
android.enableJetifier=true line,changed targetsdversion to 28, gradle versions. But when i run flutter project, this warning appear on console.I guess everything okey, but warning does not disappear. I am waiting your helps.
I would give you a workaround if thats all is not working. Umm Okay Create a new flutter project with AndroidX enabled in android studio and then copy libs , assets , modify pubspecs , and all correct the imports. Change Manifest if you did.
Related
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.
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.
I am learning flutter, and while playing around with flutter's Geolocator 3.0.0 package. I came across an issue that wouldn't let me compile the app as soon as I add the reference to this package in pubspec.yaml file. A quick google search showed me the right github issue. The fix mentioned in the github issue (migrating app to support AndroidX - by updating compileSdkVersion in build.gradle file to 28, and adding android.useAndroidX=true and android.enableJetifier=true in gradle.properties) does work.
Main question: I am not sure if this (migrating project to support AndroidX) will need to be done for all flutter projects explicitly or is there a way to ensure all new flutter projects support AndroidX.
PS:I come from C# background, and I know nearly nothing about android / iOS app development.
You need to explicitly migrate a Flutter app to Android X by using Migrate to AndroidX... button located under Refactor tab of Android Studio. Manual migration is not recommended. If a plugin requires Android X, you need to perform this migration.
For the related article on Flutter.io, see: https://flutter.io/docs/development/packages-and-plugins/androidx-compatibility
Re your main question:
' I am not sure if this (migrating project to support AndroidX) will need to be done for all flutter explicitly or is there a way to ensure all new flutter projects support AndroidX'
I have never found the 'Refactor/Migrate to AndroidX' to work. Not even on new projects. I'm not sure it does anything at all. I always had to do manually even after just creating a new project. I follow the manual instructions but also delete any old versions of gradle in c:/....gradle/wrapper/dists/gradle-???. The current one, and only one to have available is gradle-5.1.1-all.
When i go to :
File > Project Structure
I have the following 5 errors:
Library 'appcompat-v7-19.0.1' is not used
Library 'Gradle: 19.0.1' is not used
Library 'Gradle: support-v4-19.0.1' is not used
Library 'Gradle: 4.2.42' is not used
Library 'play-services-4.2.42' is not used
I can fix the problem with the icon on the right, add to dependencies and i add to the selected module, it works but if i exit Android Studio and i run it again, the errors appears again.
Those errors are spurious and you can ignore them; that they appear at all is bug https://code.google.com/p/android/issues/detail?id=60958. Having said that, unless you're running a very old version of Android Studio, they shouldn't be appearing.
I have the emergency live tracker sample apk file. So I run that application via eclipse.
I am getting an error.
Just clean your project and then rebuild it. That will automatically generate a new R file.
I had that problem and it turned out to be some weird side-effect of me not using the proper Java compiler: I used to use 1.5 for earlier SDK versions but I had to use Java 1.6.
Right Click on Project->Bulid Path->Configure Build Path ther you see error android-support-v4.jar remove this library and add library again this works fine for me.