I am 'lucky' to have been charged with maintaining a program developed by someone else, and I come across the following problem with an import statement:
import com.fizzbuzz.android.dagger.InjectingDialogFragment;
which Android Studio cannot resolve. I am totally new to dagger...
I have the following in build.gradle dependencies:
compile 'com.fizz-buzz:fb-android-dagger:1.0.1'
compile 'com.fizz-buzz:fb-android-bluetooth:1.0.3'
InjectingDialogFragment is not available in the version you are currently using. Please use compile 'com.fizz-buzz:fb-android-dagger:1.0.3' instead.
For better understating on how Dagger works you can use this blog http://antonioleiva.com/dagger-android-part-2/
Related
I'm want to implement Twitter login in my app, but I can't import any of the related classes.
In my gradle I added:
implementation 'com.twitter.sdk.android:twitter:3.3.0'
gradle sync works fine, app compiles and run, but I'm not able to import any of the com.twitter classes like TwitterConfig. If I write "Twitter" and let Android Studio suggest me the only option I get are TwitterAuthCredential and TwitterAuthProvider both from com.google.firebase.auth.
What is going on? Am I missing some gradle line?
I managed to solve it importing only the dependecies I needed:
implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
implementation 'com.twitter.sdk.android:tweet-ui:3.3.0'
implementation 'com.twitter.sdk.android:tweet-composer:3.3.0'
implementation 'com.twitter.sdk.android:twitter-mopub:3.3.0'
It migth be related to the large size of the library.
As Google APIs for Android introduced breaking changes as here I found my self un able to compile my react native android app, there are two things I need to know about:
How to avoid migrating to AndroidX and compile my project as I did before?
For example, when I have this error:
node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/ReactNativeFirebaseAppRegistrar.java:20: error: package android.support.annotation does not exist
import android.support.annotation.Keep;
how would include that missing package into build.gradle of that module?
I tried:
dependencies {
compile 'com.android.support:support-annotations:27.1.1'
}
but it did not help..
You can disable or avoid androidX with the following step
go to your android/gradle.properties file and paste or update the following
android.useAndroidX=false
android.enableJetifier=false
Although it does not update libraries we import or install, So all the libraries should be in AndroidX support otherwise project will not compile with this change I'm also having the same issue in my case project is fine but the problem is with the library called mapbox which have not support androidx I post the issue here you can check issue and comments.
I am new to Gradle, I'm now trying to use AOP to design a plugin that can manipulate bytecode. And I'm now trying to use transform APIļ¼ however I cannot get the correct library imported, like TransformManager, etc.
I know this question is a little dumb but I don't really know what to do with it... So for the following, I just copied and pasted the code from the source I'm learning from, but It's the same when I'm writing the code myself, I can't import the correct library, instead, the auto-import is
import org.apache.tools.ant.taskdefs.Transform which I didn't find in the transform api.
Can anybody explain why? and how can I solve it?
Lack of dependence,add libraries into plugin_demo/build.gradle
dependencies {
implementation gradleApi()
implementation localGroovy()
//android gradle plugin libraries
implementation 'com.android.tools.build:gradle:3.3.0'
implementation 'com.android.tools.build:gradle-api:3.3.0'
}
I'm trying to import this as a library in a project I'm working on in Android Studio:
https://github.com/d4rken/myolib
I cant workout exactly how to do it. even before I try to do this, I tried to open the project using new->Import project-> (selecting the settings.gradle). This then complained about not knowing about:
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
So I tried adding these manually using the advice on:
Importing github projects as library to existing project
Adding external library in Android studio
But its still complaining about no cached version for offline mode. If I do disable work in offline mode then, well it just sits there forever. I want to give it everything manually because in my experience disabling work in offine mode usually doesn't help.
I completely understand this isn't a new topic on Stackoverflow. The issue of how best to import libraries as .jar, .aar, .os etc. etc has been covered a few times. And yet most answers are subtly different and some work sometimes, others work other times.
Does anyone know of a detailed explanation about how I should achieve this ?
If anyone has been successful in importing this project and using its libraries I will be eternally grateful if you could tell me how you achieved such wizardry.
You import the library through your app's build.gradle file. An import section looks something like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.1.1'
compile "com.android.support:support-v13:24.1.1"
}
So to import the library you just linked, you would simply add this line to your dependencies section, as per the readme:
compile 'eu.darken.myolib:myolib:0.0.4'
So I'd like to import the "apache commons ftp" libraries for use in my project. I got as far as the importing the modules, and am including a pic just to show that they're in there.
But when I try to use the import statements
(i.e.) import org.apache.commons.net.ftp.FTP;
they fail.
So am curious if I am missing a step, or am missing something.
Please add below dependency in your gradle:
// https://mvnrepository.com/artifact/commons-net/commons-net
compile group: 'commons-net', name: 'commons-net', version: '3.5'
For any dependency to import in Android Studio through gradle use below reference:
https://mvnrepository.com/
This will save your time from importing module and solving gradle errors :)
Thank You
I would recommand AndiGeeky's answer if you don't modify so you have a custom library.
Meanwhile if you really want to use the library as a module, you can add this line in your build.gradle in your module app
compile project(':NAME_OF_YOUR_MODULE') << should be commons-net-3.5
Hope that will help you :)