Cannot add Tweet Composer dependency - android

I'm trying to add new TweetComposer to my project at module "app":
dependencies {
compile('com.twitter.sdk.android:tweet-composer:1.0.5#aar') {
transitive = true;
}
}
And I always got error like this:
Error:Could not find com.twitter.sdk.android:tweet-composer:1.0.5.
Required by:
reader-android:app:unspecified
Search in build.gradle files

I found the issue:
add at project level the following code
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
And at application level
dependencies {
compile('com.twitter.sdk.android:tweet-composer:1.0.5#aar') {
transitive = true;
}
}
You should then be able to sync Gradle correctly, let me know if that works for you!
Reference here

Related

I can't import PhotoView.What should I do?

I do not understand what to do with this plugin, I have been suffering for an hour .. My version is android studio 7.0.2
here is the code
photoViewVersion = "2.3.0"
}
dependencies {
implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}```
Make sure you have the following in the build.gradle(Project level)
allprojects {
repositories {
maven { url "https://www.jitpack.io" }
}
}
buildscript {
repositories {
maven { url "https://www.jitpack.io" }
}
}
Also try putting the dependency in the following manner in your gradle file (App level)
dependencies {
def photoViewVersion = "2.3.0"
implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}
Try adding maven { url "https://jitpack.io" } to your top level gradle build file.
See: https://github.com/Lichenwei-Dev/ImagePicker/issues/1

Could not resolve git repository as dependency in android gradle

I am trying to add a git repository (https://github.com/FHNW-IP5-IP6/ComposeForms) as a dependency into my project with Gradle and tried the below-listed variants (1.-3.) from Is it possible to declare git repository as dependency in android gradle? but every time when I sync the project I get an Error saying: "Could not resolve com.github.FHNW-IP5-IP6:ComposeForms:master-SNAPSHOT".
I tried the following:
Jitpack (https://jitpack.io/#FHNW-IP5-IP6/ComposeForms/master-SNAPSHOT)
allprojects {
repositories {
...
maven("https://jitpack.io") // also tried uri https://www.jitpack.io
}
}
and in app build.gradle
kotlin {
sourceSets {
named("main") {
dependencies {
...
implementation("com.github.FHNW-IP5-IP6:ComposeForms:master-SNAPSHOT")
}
}
}
}
Git Submodule (named as compose-forms)
include(":compose-forms") inside settings.gradle
kotlin {
sourceSets {
named("main") {
dependencies {
...
implementation(project(":compose-forms"))
}
}
}
}
New feature in gradle
Inside settings.gradle
sourceControl {
gitRepository(uri("https://github.com/FHNW-IP5-IP6/ComposeForms.git")) {
producesModule("compose-forms")
}
}
and in app build.gradle
kotlin {
sourceSets {
named("main") {
dependencies {
...
implementation("compose-forms") {
version {
branch = "master"
}
}
}
}
}
}
I'm running out of options and really need the git repository as a dependency. I would prefer not to have any git submodules inside my project so I prefer numbers 1 and 3 to work. Thanks in Advance for any hint :)
Open Android Studio as Administrator then add maven { url 'https://jitpack.io' } to both, build.gradle(project) and settings.gradle(project) and the respective implementation [...] to build.gradle(:app). This worked for me as every other solution proposed failed.

Gradle Sync failed:Could not find method compile() for arguments

i am refering this https://github.com/mopub/mopub-android-sdk/wiki/Getting-Started to integrate mopub in my app. I got an error "could not find method compile for arguments" while adding mopub-sdk dependency in my project's build.gradle file.Please help me out.
Build.gradle file:
buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}}
allprojects {
repositories {
jcenter()
}
dependencies {
compile('com.mopub:mopub-sdk:4.14.0#aar') {
transitive = true
}
// For banners
compile('com.mopub:mopub-sdk-banner:4.14.0#aar') {
transitive = true
}
// For interstitials
compile('com.mopub:mopub-sdk-interstitial:4.14.0#aar') {
transitive = true
}
// For rewarded videos. This will automatically also include
interstitials
compile('com.mopub:mopub-sdk-rewardedvideo:4.14.0#aar') {
transitive = true
}
// For native static (images).
compile('com.mopub:mopub-sdk-native-static:4.14.0#aar') {
transitive = true
}
// For native video. This will automatically also include native static
compile('com.mopub:mopub-sdk-native-video:4.14.0#aar')
{transitive = true}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Actual Error:-
Error:(31, 0) Could not find method compile() for arguments [com.mopub:mopub-sdk:4.14.0#aar, build_7edkg2m28hxg79jomt8w3j8ic$_run_closure1$_closure4$_closure5#1c36532] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
You need to put your dependencies in the other build.gradle. They belong to the individual module build.gradle files.
Also, you are importing com.mopub:mopub-sdk:4.14.0#aar, which contains all of the ad format dependencies you already have below in your Gradle file. You only need com.mopub:mopub-sdk:4.14.0#aar or the modularized artifacts.

Error:(35, 13) Failed to resolve: com.github.lguipeng:BubbleView:1.0.1

I'm trying to add bubble to a textView as shown in this video https://www.youtube.com/watch?v=EUCF4GdAQ7k
But I'm facing the given problem
Error:(35, 13) Failed to resolve: com.github.lguipeng:BubbleView:1.0.1
Show in FileShow in Project Structure dialog
Read official guideline about BubbleView . Rectify your build.gradle .
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.lguipeng:BubbleView:1.0.1'
}
In your project level gradle file add maven url
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}

Crashlytics doesn't work after migration to Fabric

I use Crashlytics SDK in my app (with Mopub and Twitter SDK's). All work normal, but after last update I dont get message with crashes.
Before update
After update (only last app version)
In my project I make all instructions from manual:
build.gradle
buildscript {
repositories {
...
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
...
classpath 'io.fabric.tools:gradle:1.+'
}
}
...
apply plugin: 'io.fabric'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
...
dependencies {
...
compile('com.crashlytics.sdk.android:crashlytics:2.2.1#aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter-core:1.0.0#aar') {
transitive = true;
}
compile('com.mopub.sdk.android:mopub:3.3.0#aar') {
transitive = true;
}
}
In my code I start Crashlytics in MainActivity:
Fabric.with(this, new Crashlytics());
P.S. Fabric plugin dont show no errors and alerts and show me crashes from previous app version.
I decided it this way: I remove my app from fabric.io, re-install fabric plugin in Android Studio, and change this lines in my build.gradle file:
compile('com.crashlytics.sdk.android:crashlytics:2.2.1#aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter-core:1.0.0#aar') {
transitive = true;
}
compile('com.mopub.sdk.android:mopub:3.3.0#aar') {
transitive = true;
}
and I change this line in my Application class:
Fabric.with(this, new TwitterCore(authConfig), new MoPub(), new Crashlytics());
Next I run my app and test this with this line:
throw new RuntimeException();

Categories

Resources