Could not find method complie() for arguments whilst adding recyclerView dependency - android

I am trying to add a dependency so I can use RecyclerView.
In andriod studio I went to build > edit libraries and dependencies. Then searched for Recycler in the choose library dependency. I found the library below.
com.android.support:recyclerview-v7 (com.android.support:recyclerview-v7:26.0.0-alpha1)
After adding this though the gradle could not build. I read on here that it was due to the version and that is should be changed to 'com.android.support:recyclerview-v7:25.3.1'.
However now I am getting a different error message which I don't follow,
Error:(30, 1) A problem occurred evaluating project ':app'.
Could not find method complie() for arguments [com.android.support:recyclerview-v7:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.xxx.yyyyyyyyy"
minSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
complie 'com.android.support:recyclerview-v7:25.3.1'
}
manifest
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

You have complie instead of compile.

Could not find method complie()
There is a small typo in your dependencies
Change:
complie 'com.android.support:recyclerview-v7:25.3.1'
with:
compile 'com.android.support:recyclerview-v7:25.3.1'

Related

Android, Getting an error, Execution failed for task ':app:processDebugManifest'. > Manifest merger failed, when trying to integrate Helpshift plugin

I'm getting this error with my code when I try and implement a plugin called Helpshift.
Error:Execution failed for task ':app:processDebugManifest'.>
Manifest merger failed : Attribute
meta-data#android.support.VERSION#value value=(26.0.1) from
AndroidManifest.xml:16:13-35 is also present at
[com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35
value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to
element at AndroidManifest.xml:14:9-16:38 to override.
I think it has something to do with the versions of the app.
Here's my manifest file:
<?xml version="1.0" encoding="UTF-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.leoconnelly.connexus">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26" android:compileSDKVersion="26" android:buildToolsVersion="26" />
<application android:allowBackup="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:roundIcon="#mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HealthCenterListActivity" />
<activity android:name=".HealthCenterSelectedActivity" />
<activity android:name=".MoreInfoActivity" />
<meta-data
android:name="android.support.VERSION"
android:value="26.0.1" />
</application>
and here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.example.leoconnelly.connexus"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:26.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
//Helpshift
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.helpshift:android-helpshift-en-aar:6.4.2'
}
I beleive I'm doing something wrong with the versions, but when I change them I get a whole other error. Any help is apperciated.
remove this line in the manifest file:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26" android:compileSDKVersion="26" android:buildToolsVersion="26" />
and in your build.gradle add this line in defaultConfig section:
buildToolsVersion '26.1.0'
do what #prem said above
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
Instead of this
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
In case the support library is a hard dependency in Helpshift sdk, you can exclude it and using your selected support library version with something like this:
//Helpshift
// use version 26.1.0 instead of 26.0.2
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
// exclude the support library
implementation ('com.helpshift:android-helpshift-en-aar:6.4.2') {
exclude group: 'com.android.support'
exclude module: 'design'
exclude module: 'recyclerview'
exclude module: 'cardview-v7'
}

Google play services update to 9.0.0 even though current version is 9.2.1

I'm having an issue with this google play services plugin. It is telling me to update from the current version to a previous one. I have looked at other threads on here and they all say to put the plugin at the end of the app based gradle, which I already did, but I am still getting the error.
Here is my manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mikediloreto.findingrestaurants">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:name=".MyApplication"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ProfileActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
And here is the app-based gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.mikediloreto.findingrestaurants"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
Here is the project based build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please let me know if you would like me to include any other code.
First of all here is something u shouldnt do
compile 'com.google.android.gms:play-services-maps:11.0.4'
and
compile 'com.google.android.gms:play-services-auth:9.2.1'
its a good practice to have on global variable for libs having the same versions
then u could do something like
compile "com.google.android.gms:play-services-auth:$google_ver"
might be that 11.xxx nd 9.xxx versions r cosing the trouble. Try using 11.0.4 instead of 9.2.1

My app is working fine in the emulator, but not in the real device

I am using Android studio 2.3 and Nexus 6 API 25 as emulator.I have created a app where I use to log in through firebase and display some images URL.Everything works fine when I run the app in emulator.
But when run the app in a real android device, the app installs and I could signup with a new user & password and checked json databse in firebase for new entry.
Till the above app works fine in real device.but when I went for login , app stops with message"Unfortunately, the app has stopped".
I followed below steps in order to troubleshoot but error still remains
1.Disabled Instant run.
2.added android:largeHeap="true" in manifest.xml to prevent from out of memory issue
3.Build .apk file in android studio and transfer to real device.
I am attaching here my gradle files, manifest files.
******build.gradle**:-****
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.win81.eathut"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//Add Library
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.android.support:design:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
****AndroidManifest.xml****
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.win81.eathut">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SignIn" />
<activity android:name=".SignUp" />
<activity
android:name=".Home"
android:label="#string/title_activity_home"
android:theme="#style/AppTheme" />
<activity android:name=".List" />
<activity android:name=".Detail"></activity>
</application>
</manifest>
My real device spec is
Model-Samsung SM-G530H
Android version:-5.0.2,API 21
Please help me.
Note:I can easily run any react native apps in this device.

Gradle Manifest Merger failed after adding compile RecyclerView

This error message popped up after being able to import RecyclerView. I can't find the source, or a fix. The error message seems pretty hard to follow as well.
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:recyclerview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:34 to override.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.me.listviewprojektfuerapp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".ui.ListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle(module:app) :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.me.listviewprojektfuerapp"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
}
You are using com.android.support:appcompat-v7:25.3.1 and also com.android.support:recyclerview-v7:26.0.0-alpha1, recycler view is a part of appcompact library and hence the clash and also it is advisable to use same library versions
for more reference - https://developer.android.com/topic/libraries/support-library/features.html
You need to compile with this version of recyclerView
compile 'com.android.support:recyclerview-v7:25.3.1'
tools:replace="android:value"<==== put it on your in application attributes or you can make 2 version of both library to same version.

Android Studio Multiple Dex file dependencies defined error

I have been trying for a week and have never tried solutions in sites.
Error Current.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexException:
Multiple dex files define
Lcom/google/android/gms/internal/zzaac$zza;
Gradle codes
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
//multiDexEnabled true
}
defaultConfig {
applicationId "com.oyunlar.dortislem"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//multiDexEnabled = true
}
buildTypes {
release {
//multiDexKeepProguard 'multidex-config.pro'
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.google.firebase:firebase-database:10.2.0'
//compile 'com.google.firebase:firebase-core:10.0.1'
//compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
//compile 'com.google.firebase:firebase-crash:10.0.1'
//compile 'com.google.firebase:firebase-ads:10.0.1'
testCompile 'junit:junit:4.12'
//compile 'com.google.android.gms:play-services:10.2.1'
//compile 'com.google.android.gms:play-services-maps:10.2.1'
}
apply plugin: 'com.google.gms.google-services'
AndroidManifest codes:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.oyunlar.dortislem">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme1"
>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DortislemOyunu"></activity>
<activity android:name=".DortislemOyunuSonuc"></activity>
<activity android:name=".TopList"></activity>
<activity android:name=".NtGirisGiris"></activity>
<activity android:name=".Admin"></activity>
</application>
</manifest>
Thank you
Thanks a lot. But now the bottom error is coming out.
enter image description here
You are including all Play services in your project. Only add those you want. For example, if you are using only maps, then change
compile 'com.google.android.gms:play-services:8.1.0'
to
compile 'com.google.android.gms:play-services-maps:8.1.0'
From the doc:
In versions of Google Play services prior to 6.5, you had to compile
the entire package of APIs into your app. In some cases, doing so made
it more difficult to keep the number of methods in your app (including
framework APIs, library methods, and your own code) under the 65,536
limit.
From version 6.5, you can instead selectively compile Google Play
service APIs into your app. For example, to include only the Google
Fit and Android Wear APIs, replace the following line in your
build.gradle file:
compile 'com.google.android.gms:play-services:8.3.0'
with these lines:
compile 'com.google.android.gms:play-services-fitness:8.3.0'
compile 'com.google.android.gms:play-services-wearable:8.3.0'
Or you can try like this in app build.gradle:
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 25
...
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
In your manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name="android.support.multidex.MultiDexApplication">

Categories

Resources