I am trying to migrate to smack 4.1. I followed the instructions provided at https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide to add smack android to my project.
I get the following error when gradle syncs
4.1.1 is the latest version.
This is what I am using in dependencies section of my current project -
compile 'org.igniterealtime.smack:smack-android:4.1.1'
// Optional for XMPPTCPConnection
compile 'org.igniterealtime.smack:smack-tcp:4.1.0'
// Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats)
compile 'org.igniterealtime.smack:smack-im:4.1.0'
// Optional for XMPP extensions support
compile 'org.igniterealtime.smack:smack-extensions:4.1.0'
This should solve your issue.
The error reported by Android Studio is that, it isn't able to find the smack-android-extensions and smack-tcp packages.
The reason was because, grade was configured in Offline Mode. It means that it won't go to the network to resolve dependencies.
Go to Preferences > Gradle and uncheck "Offline work" to disable offline mode. This solves the problem
Related
I have tried to integrate Stripe with my project. I have gone through the integration guide from https://stripe.com/docs/mobile/android. And I keep receiving an error Could not resolve com.stripe:stripe-android:6.1.2.
I have put into my build.gradle file Could not resolve com.stripe:stripe-android:8.0.0. Additionally, I have found the GitHub project that version varies from the one in the guide and I have tried it. The version number in the GitHub project is 8.0.0.
Full error log:
The short version of my dependencies in gradle:
dependencies {
...
implementation 'com.stripe:stripe-android:8.0.0'
...
}
Is there any additional maven repo or something that I should add to the gradle to be able to add this dependency to the project?
You might have enabled offline work for gradle,
Uncheck the box and sync the project again . It should fix the problem.
In my project I have many libraries defined in dependencies section in gradle. Problem is once in a while (once/twice a day)Android Studio gives me errors like this when opening the project or trying to get a release output:
Error:Unable to resolve dependency for ':TMessagesProj#armv7Debug/compileClasspath': Could not resolve com.google.android.gms:play-services-gcm:11.2.+.
My guess is it is because build tools is trying to check if there is an update for each library and when it doesn't find an Internet connection, it shows this error. If so, how can I change the setting in a way it doesn't have to check for updates? In other words in my project I don't need to update my libraries.
I know there is an offline mode that will probably do the trick! But I don't want to use this feature because it will probably disable some other useful features too. I just want to prevent it from automatically checking for library updates(If that's the problem shown above).
I included some part of my dependencies in gradle here:
dependencies {
compile 'com.google.android.gms:play-services-gcm:11.2.+'
compile 'com.google.android.gms:play-services-maps:11.2.+'
compile 'com.google.android.gms:play-services-vision:11.2.+'
compile 'com.google.android.gms:play-services-wallet:11.2.+'
}
Dependencies with a plus like 11.2.+' will always lead to repeated builds.
You have to specify the full version like:
com.google.android.gms:play-services-gcm:11.2.0
If you do not specify gradle will always be building because its looking for the latest version online of 11.2.+ may be 11.2.4, 11.2.6 etc
I have the facebook audience network dependency in my list of dependencies. It used to work, but it stopped resolving for no discernible reason.
compile 'com.facebook.android:audience-network-sdk:4.+'
I'm not in offline mode.
EDIT:
Changing the build variant gives a more descriptive error message.
I have a feeling they've pulled that version. For now fall back on the previous version:
compile 'com.facebook.android:audience-network-sdk:4.13.0'
There was a problem with the POM file. Version 4.14.1 has been deployed with the fix. So you can now go ahead and use the latest version via gradle. Specifying 4.+ will automatically use the 4.14.1 version.
I'm a beginner in android studio and I try to use a recyclerView. When I try to add compile 'com.android.support.recyclerview-v7:21.0.+' to my gradle file, I get the error:
failed to resolve com.android.support.receyclerview-v7v7:21.0.+.
It proposes me to install repository and sync project. when I click it, i get this error:
SDK Path C:\User\userName\AppData\Local\Android\sdk1
loading SDK information
ignoring unknown package filter 'extra-android-m2repository' warning: The package filter removed all packages. There is nothing to install. Please consider trying to update again without a package filter.
install failed, please check your network connection and try again. You may continue with creating your project, but it will not compile correctly without the missing components.
I mention that I'm using sdk 23.0.0 on a windows system, and when installing android studio for the first time I got an error message that concern proxy (that i unfortunately skipped)!!
Any idea to solve this problem ??!!!
First of all, run the SDK Manager and check if your support libraries repository is updated.
Then open your build.gradle (not the top level file) and add:
dependencies{
//....
compile 'com.android.support:recyclerview-v7:23.0.0'
}
Pay attention. You report in your question a typo in your library (compile 'com.android.support.recyclerview-v7:21.0.+')
Using the v23 you have to compile with API23.
Of course you can use a "old" version using:
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:21.1.3'
I am trying to run the XMPP-based App Server based on Smack library
I'v added the required dependencies based on smack 4.1.0. I have problem with one Import:
import org.jivesoftware.smack.PacketInterceptor;
I experience the error message
Cannot resolves symbol PacketInterceptor
How do I resolve this?
If you are using gradle, use following dependencies
compile "org.igniterealtime.smack:smack-java7:4.0.1"
compile "org.igniterealtime.smack:smack-extensions:4.0.6"
compile "org.igniterealtime.smack:smack-tcp:4.0.6"
Or download the jar for the smack 4.0.6
Apparently, in the latest 4.1.0-Beta version they made some change to API but lack of enough clear documents.