Whorlwind and RxJava2 - android

I have a question regrading RxJava2 support in WhorlWind.
I am converting a project which uses Whorlwind from Rx1 -> Rx2. My current Whorlwind version in my root project gradle is 1.0.1, which according to their github CHANGELOG.MD is the only version.
https://github.com/square/whorlwind/commit/769ad313154df46ce07638dc79bd46ae14e5fbfb
As you can see, the commit above has made the changes to support rxjava2 however I am not able to find a version number to update in my gradle. There must be some key concept I'm missing because how I understand it, the Whorlwind library on my machine will remain at the RxJava1 build until I update the gradle to bring in some new Whorlwind library.
Thanks

I ran into the same issue with that library, what I did to move forward was to use the library the same way that the sample app that they have uses it. By adding the library to your project and referencing the library from there.
See their build.gradle here:
https://github.com/square/whorlwind/blob/master/whorlwind-sample/build.gradle

https://github.com/square/whorlwind/commit/47961437c611abc4ec88c900cdb6621ef6662b1c
In the gradle.properties, Square lists a snapshot of a newer version that supports Rx2. I'm not sure why they don't list it in the ChangeLog or ReadMe

Related

<androidx.appcompat.widget.AppCompatEditText>

hello i want to use androidx library but it's not showing for me and i tried Refactor->Migrate to androidx and it didn't work too
can i get help please..
https://i.stack.imgur.com/xHNJ9.png
Make sure all those dependencies are added to your project. Then still face your problem go to the android studio file->invalid caches and restart.
https://i.stack.imgur.com/cXzGu.png
I want to use androidx library but it's not showing for me and I tried Refactor->Migrate to androidx and it didn't work too
Looking at below picture: https://i.stack.imgur.com/cXzGu.png
You can't use androidx for TextInputEditText because that widget is a property of Google material design. That means, the intellisense autocomplete dialog is showing you the exact and correct code. Check here and see the artifact mapping list of android support library to androidx or android jetpack
But before then, according to this post it reads:
With Android Studio 3.2 and higher, you can migrate an existing project to AndroidX by selecting
Refactor > Migrate to AndroidX from the menu bar.
The refactor command makes use of two flags. By default, both of them are set to true in your gradle.properties file:
android.useAndroidX=true
The above ☝️ will allow Android plugin to make use of the appropriate AndroidX library instead of Android Support Library.
android.enableJetifier=true
The above ☝️ Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries.
In conclusion, if above lines of codes are not in your gradle.properties file then you can add them and sync gradle
Note: The built-in Android Studio migration might not handle everything. Depending on your build configuration you may need to update your build scripts and Proguard mappings manually. For example, if you maintain your dependency configuration in a separate build file, use the mapping files mentioned below to review and update your dependencies to the corresponding AndroidX packages.

Using Kotlin and buildSrc for build.gradle Won't Show Available Library Version Updates?

As the title mentions, I am using buildSrc and Kotlin for Gradle Dependency management in a modularized android project as per the following tutorial:
https://caster.io/lessons/gradle-dependency-management-using-kotlin-and-buildsrc-for-buildgradle-autocomplete-in-android-studio
it's working all fine but the question is how can I be notified if there are any libraries that have an update on their version? (i am not getting the notification on the library where it gets marked showing that there is an update)
is there another way of doing this?
There are a few approaches you can take here:
Leave out the dependencies in build.gradle. Currently, there is no hint shown in Android Studio if you extract out them into variables. So you can just use strings here.
Use Gradle-versions-plugin to check for dependency updates. You can read more about this here.

How do I use the standalone Jetifier to migrate to AndroidX?

The Jetifier tool is used as part of the AndroidX migration tool bundled with Android Studio. There is an issue with the tool, however, that is outlined here: https://issuetracker.google.com/issues/113224601.
The error message looks like this when running the Jetifier on certain libraries (one particular library keeps popping up for multiple users: org.eclipse.jdt.core):
Failed to transform '/path/to/library/org.eclipse.jdt.core-3.10.0.jar' using Jetifier.
Reason: The type does not support '.' as package separator!
This issue has been fixed for a while in the Jetifier tool itself, but the fixed version has not been included in any Android Studio updates yet (even the latest canary build).
I can confirm that running the standalone Jetifier works in transforming the problematic libraries, but I have no idea how to get these transformed libraries into our project. Off the top of my head, I can think of two different ways to get this migration to AndroidX to work:
Run the standalone tool on each library and instruct Gradle to use those versions (I might need to tell the Gradle tasks not to run the Jetifier on them)
Instruct the Gradle tasks to use the standalone tool in place of the one shipped with Android Studio.
Any help getting either of the above suggested fixes to work would be greatly appreciated (or if there is another way, I'd love to know about it). The internals of the Android Gradle build system are incredibly complicated, and I really need some gurus' assistance to get past this roadblock.
This is a serious road block for us since we want to begin the process of migrating our app in parallel with our development. There are a lot of things we need to iron out with this migration, and being ready to "flip the switch" when the tool is finally updated would help keep our releases on track.
Thanks!
Actually, from that same thread that I linked, there's a workaround:
Sorry jetifier beta01 was not binary compatible with alpha10.
Please try:
buildscript {
dependencies {
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
}
}
So, I guess now you can specify the newest version of the Jetifier in your buildscript.
I really should have scrolled all the way to the bottom of that thread before posting this, but now hopefully this workaround is more visible to people.
UPDATE
It seems this workaround does not work with DataBinding enabled. It looks like the new Jetifier tool is trying to run on the old version:
Failed to transform '/path/to/library/jetifier-core-1.0.0-alpha10.jar'
using Jetifier. Reason: The given artifact contains a string literal
with a package reference 'android/support/v4' that cannot be safely
rewritten. Libraries using reflection such as annotation processors
need to be updated manually to add support for androidx.
UPDATE 2 (20 Nov 2018):
There is a workaround to the issue of Jetifier trying to Jetify itself being released in AGP 3.3.0-rc01 and 3.4.0-alpha04. The devs are adding the ability to blacklist libraries from being Jetified. In your gradle.properties file, add a comma-separated list of Regular Expressions to match what files you don't want the Jetifier to touch. For example:
android.jetifier.blacklist = doNot.*\\.jar
Would exclude /path/to/doNotJetify.jar
I´m a bite late to the party, but I think there is only one fast option to solve that issue:
Go to Google Archives, Agree save and terms and download Android Studio 3.3 Beta 2 - this is the latest version before the problem occurs. You also have to downgrade your build.gradle to
classpath 'com.android.tools.build:gradle:3.3.0-beta02'
using gradle-4.10.2-all should be no problem.
Perhaps the problem will be fixed with the next beta or canary release, but for now this was the only option that worked out for me.

Using Dependencies or import Module from Github?

I have one doubt regarding using library from GitHub to Android Studio if anyone help me to solve my doubt, I would be thankful.
My question is
if we want to use library from GitHub , we have two option
either we can use dependencies to import library in project
or we can download the library from GitHub and use it as a module in our project
from above option which one would be good way to use library? (from all perspective)
Dependency
Because whenever a new version of a library arrives you don't have
to continuously check and look for it, let your build tool take care
of that. It can be cumbersome to regularly download and manage
different versions of libraries. That's where build tools like
Gradle comes in and informs you about an update and download it for
you.
You should always use library from github via using dependencies. Why?
You probably won't have times to check and fix the bugs of the library in the future.
You need more time to learn about the library nuts and bolts to maintain and update the library in the future.
You probably don't have enough expertise about the domain of the library.
You need to catch and recreate the bugs you found in your system. So, you need to keep an exact version of each libraries in your project.
You can update and change your dependencies easily without afraid of introducing new bugs.
Make your project clean.

How can you add external dependencies to bazel

I am a student and currently working on a project where I am trying to connect my game that which I have created with Android Studio. A neural network has also been made with Tensorflow which is going to be used for the android game.
The problem is that Android Studio uses a build tool which is called Gradle and Tensorflow uses Bazel. To solve this problem I have been trying to build my android game with Bazel but I am stuck at the part where I have to add the used external dependencies. For the game I use the following dependencies:
Appcompat
Support
Percent
Which supposedly should come with the android support repository.
I have looked at http://www.bazel.io/docs/external.html and several other sources but I still do not understand how I can add the dependensies. Could someone provide me with an example how to do it with for example appcompat and what I have to do to make it work? Or is there another way which would be easier?
EDIT: I have have been succesful in building the android example of Tensorflow but this: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android
But it doesn't include dependensies which I am using.
You may want to look at the Makefile support we just added for Android:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile
It's still very experimental (and fiddly), but should let you build a static library that you can more easily use in your gradle project.
Nevermind I resolved my issues, after removing the depensies I checked the WORKSPACE file. It seems I didn't set the package correctly, my bad.

Categories

Resources