I followed a tutorial online to implement adobe creative sdk and end up, when I sync my application I got these two errors
Error:(65, 14) Failed to resolve: com.adobe.creativesdk.foundation:auth:0.3.94
Show in File<br>Show in Project Structure dialog
Error:Failed to resolve: com.adobe.creativesdk.image:4.0.0:
Open File
Did some research but could not solve this new issue previous issue was solved. I'm new to android so how can i solve this issue?
build.gradle:
apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
defaultConfig {
minSdkVersion 10
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
allprojects {
repositories {
mavenCentral()
jcenter()
mavenLocal()
maven {
url "${project.rootDir}/creativesdk-repo/release"
}
}
}
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile 'com.adobe.creativesdk.foundation:auth:0.3.94'
compile 'com.adobe.creativesdk.image:4.0.0'
}
There is an issue in your dependencies block. Note that the line for the Image Editor UI component should be written as:
compile 'com.adobe.creativesdk:image:4.0.0'
Before the word image, there should be a colon, not a period.
If after that you are still having trouble with the dependencies, please see this answer.
Related
I've been having this issue for a while and have been racking my brain.
I googled this answer here
Which the response is "Make sure you open the project from its root directory. i.e. the directory which contains the top level build.gradle file."
My question is: How the do I do that if I cloned the project from bitbucket?
Here's a screenshot of my file tree:
Thank you for any insights
Edit: Gradle files
// 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:1.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
app level:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '4.0.0'
def JacksonVersion = '2.6.0'
def GPSVersion = '6.5.87'
dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:preference-v7:23.0.0'
}
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName "appname"
logLevel 'TRACE'
logAppenderConsole 'true'
}
}
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "appname"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
Your project is not Gradle based because settings.gradle and bulid.gradle are not in the IDE project directory, they are in that blacked-out subfolder under .idea and .gradle in your picture.
You must close this project. Open that other folder as an Android Studio Project, regardless of where you got that project from.
For library projects in Github, it would look like this. Anyone can clone this as-is and open as a project.
For apps, replace sample with app, and remove library
Most importantly, buildscript and allprojects section should not be in /app/build.gradle, only /build.gradle
Additionally, your Gradle build plugin is outdated
The top level should look like this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The app level file should look like this:
apply plugin: 'com.android.application'
def AAVersion = '4.0.0'
def JacksonVersion = '2.6.0'
def GPSVersion = '6.5.87'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) //This is where your JARs go
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.android.support:design:23.0.0'
implementation 'com.android.support:recyclerview-v7:23.0.0'
implementation 'com.android.support:preference-v7:23.0.0'
}
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "appname"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
You need to remove the android-apt plugin from it because the functionality is already included. If you later run into trouble, check this question.
Building in windows powershell . Already tried java version 8 and gradle update
./gradlew build.gradle
Support for running Gradle using Java 7 has been deprecated and is scheduled to be removed in Gradle 5.0. Please see https://docs.gradle.org/4.4/userguide/java_plugin.html#sec:java_cross_compilation for more details.
FAILURE: Build failed with an exception.
Where:
Build file 'C:\ProjectChaayos\KettleAndroid\assembly\build.gradle' line: 10
What went wrong:
A problem occurred evaluating project ':assembly'.
java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Below is the build.gradle file on which error is shown in console i.e
assembly/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
maven {
url "https://repo.eclipse.org/content/repositories/paho-releases/"
}
google()
}
android {
compileSdkVersion project.ext.compileSdkVersion
lintOptions {
disable 'MissingTranslation'
}
/*splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk true
}
}*/
dataBinding {
enabled = true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
defaultConfig {
applicationId "kettle.android_phase3"
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode 4
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "app_name", "Assembly screen v2 app"
}
debug {
debuggable true
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
resValue "string", "app_name", "Assembly screen app v2 debug"
}
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion project.ext.buildToolsVersion
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':common')
compile project(':printer')
compile('com.crashlytics.sdk.android:crashlytics:2.6.2#aar') {
transitive = true;
}
compile 'testfairy:testfairy-android-sdk:1.+#aar'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile('io.socket:socket.io-client:0.8.3') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile 'pub.devrel:easypermissions:1.1.3'
}
As you can see error thrown on line 10
:apply plugin'com.android.application'
gradle-wrapper.properties:-
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
It doesn't look like you're referencing gradle in the build.gradle file
I would expect to see the dependency listed like
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
with the appropriate gradle version
I'm trying to import a Jgrapht library in my app, but every time i try to build APK, android studio shows me:
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'.
com.android.sched.scheduler.RunnerProcessException: Error during 'TypeLegalizer' runner on 'private final synthetic int org.jgrapht.alg.vertexcover.-$Lambda$25.$m$0(java.lang.Object arg0)': Unexpected error during visit: com.android.jack.ir.ast.JReturnStatement at "Unknown source info"
What is the problem and how i can fix it? Please help me!
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
defaultConfig {
applicationId "it.univpm.gruppoids.iotforemergencyandnavigation"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
compileOptions {
incremental true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
maven {
url "https://mint.splunk.com/gradle/"
}
}
packagingOptions {
exclude 'META-INF/services/org.apache.sis.storage.DataStoreProvider'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
}
/*buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}*/
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:percent:25.0.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
compile 'com.google.zxing:core:3.2.1'
compile files('lib/jgrapht-ext-1.0.0-uber.jar')
compile files('lib/jgrapht-ext-1.0.0.jar')
compile files('lib/jgrapht-demo-1.0.0.jar')
compile files('lib/jgraph-5.13.0.0.jar')
compile files('lib/antlr4-runtime-4.5.3.jar')
compile files('lib/jgrapht-core-1.0.0.jar')
}
And the other gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
/*maven {
url "https://plugins.gradle.org/m2/"
}*/
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'me.tatarka:gradle-retrolambda:3.3.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
apply plugin: 'me.tatarka.retrolambda'
task clean(type: Delete) {
delete rootProject.buildDir
}
The easiest way I can think of is to use maven, then simply add the dependencies to your project. That'll save you a lot of hassel in setting up JGraphT by yourself.
you can find how to use maven with android studio here: How to import Maven dependency in Android Studio/IntelliJ?
While JGraphT's dependencies are here under the "Maven Releases" section:
http://jgrapht.org/
I am always getting java.lang.ClassNotFoundException: ru.ooolpi.lpiapp.ui.activity.MainActivity. But I have such class. Later I discovered that my project files are missing from apk.
My build script:
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
// classpath 'org.robolectric.gradle:gradle-android-test-plugin:0.10.1'
//classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
}
}
//apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
repositories {
maven { url 'https://github.com/donnfelker/mvn-repo/raw/master/' }
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
jcenter()
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.squareup.dagger:dagger:1.2.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup:otto:1.3.8'
apt 'com.squareup.dagger:dagger-compiler:1.0.1'
}
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
//applicationId "ru.ooolpi.lpiapp"
minSdkVersion 10
targetSdkVersion 22
versionCode 2
versionName "1.0.1"
multiDexEnabled true
}
packagingOptions {
// Exclude file to avoid
// Error: Duplicate files during packaging of APK
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/notice.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
signingConfigs {
release {
storeFile file('../devcert.jks')
storePassword '123456'
keyAlias 'dev'
keyPassword '123456'
}
}
lintOptions {
//disable 'InvalidPackage'
abortOnError false
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
zipAlignEnabled true // this is default for release
}
debug {
applicationIdSuffix '.debug'
minifyEnabled false
}
}
}
I tried to build with Android Studio and just with gradlew. Result is the same - my files are not included into apk.
Update:
My project structure
Have a look at your proguard config file.
Make sure you don't strip off any class that you use in your apk. To manually keep the classes, add these lines:
-keep class ru.ooolpi.lpiapp.** { *; }
-dontwarn ru.ooolpi.lpiapp.**
The issue was that I used different versions for dagger and it's compiler.
How it was:
compile 'com.squareup.dagger:dagger:1.2.2'
apt 'com.squareup.dagger:dagger-compiler:1.0.1'
It should look like:
compile 'com.squareup.dagger:dagger:1.2.2'
apt 'com.squareup.dagger:dagger-compiler:1.2.2'
So, Android Studio refused to highlight issues in my code (I don't know why these things are related).
I have an IntelliJ Gradle project which contains an Android module, a GWT module and a pure Java module.
Is there a way to add the classpath for 'com.android.tools.build:gradle:1.0.0' such that it is not in a buildscript?
Here is my 'build.gradle' for the Android module:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
// workaround for "duplicate files during packaging of APK" issue
// see https://groups.google.com/d/msg/adt-dev/bl5Rc4Szpzg/wC8cylTWuIEJ
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.1+'
}
And here is my top-level 'build.gradle'
allprojects {
repositories {
mavenCentral()
}
}
Thank you!