I'm trying to create a google glass app(immersion based) on Android Studio 1.1.0 and this error throws up.
Error:Could not normalize path for file 'C:\Users\admin\AndroidStudioProjects\Sampleapp\app\build\intermediates\mockable-Google Inc.:Glass Development Kit Preview:19.jar'.
The filename, directory name, or volume label syntax is incorrect
I previously tried on eclipse and it all worked fine but in Android Studio it's a little weird.
Update
Project: build.gradle
apply plugin: 'com.android.application'
repositories {
jcenter()
flatDir {
dirs 'prebuilt-libs'
}
}
android {
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "example.com.Sampleapp"
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
This error appears if you use
classpath 'com.android.tools.build:gradle:1.1.0'
The highest level of Gradle build tools supported for Glass development is
classpath 'com.android.tools.build:gradle:1.0.1'
You could use a classpath of 1.1.+ instead. Either way, it probably has something to do with the inability of Gradle to escape the dot after Google Inc. in the path.
Let me know if that works for you.
Related
This question already has an answer here:
When using compile 'com.google.android.support:wearable:2.0.4' I get the error below, but I am not using 26.0.0
(1 answer)
Closed 5 years ago.
I'm developing a music application for both mobile & wear. I've completed building the base of the application on mobile, and now I want to start the wearable (2.0) part. I tried following the tutorial on the Android Developer site, but even following the base directions gives me a Gradle sync error. I tried adjusting the compileSdkVersion and targetSdkVersion both to 24, which I use for my mobile gradle scrip. It didn't make a difference however.
This is the instruction mentioned:
In the build.gradle file for the Wear module:
>> In the android section, confirm that the compileSdkVersion is set to 25.
>> In the android section, confirm that the targetSdkVersion is set to 25.
Update the dependencies section as follows (requires the latest version of the Google Repository):
compile 'com.android.support:wear:26.0.0'
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
.
Clicking on "install repository and sync project" has no effect.
This is the build.gradle file for the Wear module.
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "be.ehb.dt.finalwork_lievenluyckx_v001"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:wear:24.0.0'
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
}
I'm really new to Android, and I don't really understand what is going wrong here. Any help is appreciated, even if it isn't a direct solution to the issue!
Edited: After trial-error,solution finally was found:
In build.gradle file -> allprojects, within repositories,code below should be added...
1) For the Android Gradle plugin revision 2.3.3 with Gradle 3.3 (Android Studio 2.3.3)
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
2) For the Android Gradle plugin revision 3.0.0 with Gradle 4.1(Android Studio 3.0.0)
allprojects {
repositories {
jcenter()
google()
}
}
For more here: When using compile 'com.google.android.support:wearable:2.0.4' I get the error below, but I am not using 26.0.0
Change your gradle to:
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "be.ehb.dt.finalwork_lievenluyckx_v001"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:wear:26.0.0'
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
}
I'm a newbie with gradle and I'm having a dependecy problem. I have the follow project structure:
-MyApp
-MyAppLibrary
-MyAppPro
-MyAppFree
-ThirdPartyLibraryWrapper
--libs\ThirdPartyLibrary.aar
Both MyAppPro and MyAppFree depend on MyAppLibrary, which depends on ThirdPartyLibraryWrapper. As the name suggests, ThirdPartyLibraryWrapper is a wrapper on an external library, namely ThirdPartyLibrary.aar.
This is my configuration:
build.gradle MyAppPro
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example"
minSdkVersion 8
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
compile project(':MyAppLibrary')
}
build.gradle MyAppLibrary
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
compile project(':ThirdPartyLibraryWrapper')
compile 'com.squareup.picasso:picasso:2.5.2'
}
build.gradle ThirdPartyLibraryWrapper
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile(name: 'ThirdPartyLibrary-0.1.0', ext: 'aar')
compile "com.android.support:support-v4:22.0.0"
compile fileTree(dir: 'libs', include: 'volley.jar')
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
}
When gradle sync completes, I have got this error:
MyApp/MyAppFre/ build.gradle: failed to resolve ThirdPartyLibrary-0.1.0
MyApp/MyAppLibrary/ build.gradle: failed to resolve ThirdPartyLibrary-0.1.0
MyApp/MyAppPro/ build.gradle: failed to resolve ThirdPartyLibrary-0.1.0
Can someone help me figure out where is the issue?
The other projects are seeing that the :ThirdPartyLibraryWrapper project depends on an artifact called ThirdPartyLibrary-0.1.0:aar. Java (and Android) libraries do not bundle their own dependencies together - instead, they simply publish a list of their dependencies. The consuming project is then responsible for loading not only the library it directly depends on, but all of the libraries that library depends on.
The net effect of this is that :MyAppFree is loading in :ThirdPartyLibraryWrapper, then seeing that :ThirdPartyLibraryWrapper depends on ThirdPartyLibrary-0.1.0:aar and so thus trying to load that in as well. However, :MyAppFree doesn't know where ThirdPartyLibrary-0.1.0:aar lives.. and so it fails.
The solution will be to place similar repositories blocks in all your other projects. Try this:
repositories {
flatDir {
dirs project(':ThirdPartyLibraryWrapper').file('libs')
}
}
Using the project(...).file(...) method will free you from having to hardcode paths, and will instead use the Gradle DSL to resolve the filesystem path by looking up the project and having it do the resolution dynamically.
I heard of something about Data Binding early today. Since I wanted to have a try of it and know about it, I created a test project.
Data Binding is is a support repository available on API 7+. with dataBinder, we are capable of saying goodbye to findViewById (which is complained about a lot by developers) when binding application logics and layouts.
Here are information about my project:
Android Studio:
Current version: Android Studio 1.3
Build number: AI-141.2071668
Android SDK Tools: 24.3.3
Android Platform Version: MNC revision 2
Project build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta4'
classpath 'com.android.databinding:dataBinder:1.0-rc0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Module build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'
android {
compileSdkVersion 'android-MNC'
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "me.danielpan.databindingsample"
minSdkVersion 9
targetSdkVersion 'MNC'
versionCode 1
versionName '1.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
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
}
And when I run this project on a Genymotion Emulator(which is Nexus 5 in Android 5.1.0), errors happened:
Installing me.danielpan.databindingsample
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/me.danielpan.databindingsample"
pkg: /data/local/tmp/me.danielpan.databindingsample
Failure [INSTALL_FAILED_OLDER_SDK]
DEVICE SHELL COMMAND: pm uninstall me.danielpan.databindingsample
DELETE_FAILED_INTERNAL_ERROR
So, I have some questions:
1, DELETE_FAILED_INTERNAL_ERROR happened many times. It seems that this error happens when I set
compileSdkVersion 'android-MNC'
buildToolsVersion "23.0.0 rc3"
So, it's the problem of Android Build Tools of this version?
2, I followed Data Binding Guide, but I think it's old. Because Gradle Plugin has been 1.3.0-beta4, version of dataBinder should have evolved since released. So, what's is the latest version of Data Binding Plugin?
Any tips will be appreciated. Thanks in advance.
P.S.:
When I set version of Gradle Plugin 1.2.3, buildToolsVersion "22.0.1" compileSdkVersion 22, and targetSdkVersion 22, DELETE_FAILED_INTERNAL_ERROR doesn't happen again, Could somebody tell me why?
I can answer the second question. RC1 was just released, though the documentation has not been updated yet. It will read:
dependencies {
classpath "com.android.tools.build:gradle:1.3.0-beta4"
classpath "com.android.databinding:dataBinder:1.0-rc1"
}
I'm getting these errors when trying to use an external library imported (as a Maven file dependency) through the Project Structure > Dependencies window in Android Studio 1.0 RC 2:
W/dalvikvm﹕ Unable to resolve superclass of Lcom/melnykov/fab/FloatingActionButton$1; (1487)
W/dalvikvm﹕ Link of class 'Lcom/melnykov/fab/FloatingActionButton$1;' failed
My build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "user.appname"
minSdkVersion 18
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.android.support:recyclerview-v7:21.0.2'
compile 'com.android.support:cardview-v7:21.0.2'
compile 'com.melnykov:floatingactionbutton:1.1.0'
}
I've googled around and most solutions are for projects in Eclipse, involving setting the Java Build Path to Order and Export, but I can't seem to find a similar setting in Android Studio.
Thanks!
Given that you added
repositories {
mavenCentral()
}
to your build.gradle, I think that your issue is caused by gradle not being able to reach external resources.
Are you behind a proxy?
I solved this problem adding file gradle.properties in my home .gradle directory. It's made like this:
systemProp.http.proxyHost=myproxy.mydomain.it
systemProp.http.proxyPort=myproxyport
systemProp.http.proxyUser=myproxyuser
systemProp.http.proxyPassword=XXXXXXXX
systemProp.https.proxyHost=myproxy.mydomain.it
systemProp.https.proxyPort=myproxyport
systemProp.https.proxyUser=myproxyuser
systemProp.https.proxyPassword=XXXXXXXX
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
I have upgraded to Android Studio Beta (0.8.0) version from earlier 0.6.x version. After upgrade all the projects (which were working earlier) throws error "Cannot resolve symbol" for everything - String, Activity, file, view - everything. I have done a clean and rebuild;
Obviously I have missed something in the upgrade; What could that be?
And my settings.gradle is:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.grabdata.gdlea.apps"
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// You must install or update the Support Repository through the SDK manager to use
this dependency.
// You must install or update the Support Repository through the SDK manager to use
this dependency.
compile 'com.android.support:appcompat-v7:19.+'
}
Ran into the same issue. I cleaned and rebuilt the project and everything worked again.