Getting an error with leak canary when doing my gradle sync:
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.
My build:
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.assistek.ediary"
minSdkVersion 12
targetSdkVersion 12
}
dependencies {
compile 'joda-time:joda-time:2.4'
compile 'joda-time:joda-time:2.4'
compile 'joda-time:joda-time:2.2'
compile files('libs/android-support-v13.jar')
compile files('libs/commons-collections-3.2.1.jar')
compile files('libs/commons-lang-2.6.jar')
compile files('libs/commons-net-2.2.jar')
compile files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar')
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}
Too old a builde for this library?
Set compileSdkVersion 21. That will make 'android:Theme.Material' available fot your app.
Related
I have tried to find out solution from last 3 hours but didn't find any.
I can build gradle but can't compile to build apk file.
Code Snapshot
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.0'
defaultConfig {
applicationId "com.xerstech.test"
minSdkVersion 16
targetSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
...
dependencies {
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation "com.android.support:design:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation "com.android.support:support-core-utils:28.0.0"
implementation "com.android.support:support-media-compat:28.0.0"
implementation "com.google.android.gms:play-services-maps:28.0.0"
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
I have am really stumped...
I have an Android Studio (version 1.4) project consisting of two modules - androidLVL and myApp. When I attempt to build the project (Build -> Rebuild Project) I get these messages:
:myApp:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myApp:processDebugManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Previous answers to this question indicate the error can be caused by incompatible sdk version numbers in the gradle build files - but I can't figure out what the correct versions should be. I edited the build files, but to no avail. Can someone please help? Here are the two gradle build files:
androidLVL:
apply plugin: 'com.android.library'
android {
// compileSdkVersion 22
compileSdkVersion 'Google Inc.:Google APIs:8'
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 10
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}
dependencies {
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.android.support:appcompat-v7:22.0.+'
}
myApp:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:8'
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.tomoreilly.myApp"
minSdkVersion 10
targetSdkVersion 22
compileSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard-android.txt', 'proguard-project.txt'
}
}
}
dependencies {
compile project(':androidLVL')
compile files('libs/acra-4.2.3.jar')
compile files('libs/htmllexer.jar')
// compile "com.android.support:appcompat-v7:21.0.3"
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
}
(Re the error message suggestion to 'run with --stacktrace option' etc. - I do not know how to invoke these options from within Android Studio).
I got the following error in Android Studio while creating project...
Error:(24, 0) Project with path ':wear' could not be found in project ':mobile'.
This is my build.gradle file code, I want to resolve this issue. Any help appreciated...
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.user.usereventdemo"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
Looking at your settings.gradle, is it including :wear,?
if you don't want codes of wear, then delete :wear, and wearApp project(':wear') in your build.gradle.
if you want, then you have to find codes of wear, I'm afraid.
Under Gradle Scripts folder in Android Studio, locate "settings.gradle".
Open it and add ':wear' to the end of include statement.
It should look something like this:
include ':mobile', ':glass', ':wear'
Can anyone tell me how to generate signed apk of next version of any app in android studio??? In which file do I have to update? I am not familier with android studio
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.app"
minSdkVersion 11
targetSdkVersion 21
}
add the lines versionCode and versionName below the line targetSdkVersion 21
For example if your app version is 1.0 your gradle file will be
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.app"
minSdkVersion 11
targetSdkVersion 21
versionCode 10
versionName "1.0"
}
and if your app version is 2.0.3 your gradle file will be
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.app"
minSdkVersion 11
targetSdkVersion 21
versionCode 203
versionName "2.0.3"
}
Scroll to the left of the screen in Android Studio and click on build variants.
Select "release".
Scroll to the top of the screen and select "Build".
Select "Generate Signed Bundle/APK".
Create a new keystore and SAVE YOUR PASSWORD
Finally, select "Generate" or "Build" and after a bit a file will appear called something like "release.apk".
Here is the google documentation: Here
There are my actions:
1) Add file google-play-services.jar from sdk directory in "libs" directory in my project.
2) Add dependency "compile files('libs/google-play-services.jar')" in build.gradle in my project (not in solution).
Sync Project is complete succesfully, but after running application i see that error:
Execution failed for task ':TestMcSiRun:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\SDK\sdk\sdk\build-tools\19.0.2\dx.bat --dex --output C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\dex\debug C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\classes\debug C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\dependency-cache\debug C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\pre-dexed\debug\classes-2b5c8c8b2a23992eb9323b131861658b5a6c4592.jar C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\pre-dexed\debug\classes-442363482f1c8783c26a5e38b6ee593d3f54a067.jar C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\pre-dexed\debug\google-play-services-da249c1d3c777ecbc074adaa5e3cd781485d270c.jar C:\Users\MCSIMUSIC\AndroidStudioProjects\TestMcSiRun\TestMcSiRun\build\pre-dexed\debug\support-v4-18.0.0-00a4eeb2a43f491f4d8b1d7286b2ebe4b40b994e.jar
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
What do I do wrong?
my build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 18
buildToolsVersion '19.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 15
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.+'
compile 'com.google.android.gms:play-services:4.0.30'
//compile files('libs/google-play-services.jar')
}
You have something like this:
dependencies {
compile 'com.google.android.gms:play-services:4.0.30'
compile files('libs/google-play-services.jar')
}
But that's including the library twice. It's sufficient to have just this:
dependencies {
compile 'com.google.android.gms:play-services:4.0.30'
}
It will compile correctly, and it will include the right library in your APK.