Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import&run sample inside Android-Studio #39

Closed
AndroidDeveloperLB opened this issue Jan 7, 2015 · 17 comments
Closed

Failed to import&run sample inside Android-Studio #39

AndroidDeveloperLB opened this issue Jan 7, 2015 · 17 comments

Comments

@AndroidDeveloperLB
Copy link

I just get this message:

"
Error:Execution failed for task ':alertdialogpro-core:processReleaseResources'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files (x86)\Android\android-sdk\build-tools\21.0.0\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-sdk\platforms\android-21\android.jar -M C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\bundles\release\AndroidManifest.xml -S C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\res\release -A C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\bundles\release\assets -m -J C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\generated\source\r\release --custom-package com.alertdialogpro --non-constant-id -0 apk --output-text-symbols C:\Users\user\AndroidStudioProjects\AlertDialogPro\alertdialogpro-core\build\intermediates\bundles\release
Error Code:
-1073741819
"

How come? It worked fine in the past...

@fengdai
Copy link
Owner

fengdai commented Jan 8, 2015

I haven't meet that error. Try to clean your project.

@AndroidDeveloperLB
Copy link
Author

It didn't help. Using Android Studio 1.0.2 .
Maybe you could update the build tools that the project uses? Most updated one is 21.1.2

@fengdai
Copy link
Owner

fengdai commented Jan 8, 2015

My Android Studio is 1.0.2. And after I change build tools to 21.1.2, it still works fine...

@AndroidDeveloperLB
Copy link
Author

I meant the build tools configuration of the library. I've now tried to import it again (using this git URL: "https://github.com/fengdai/AlertDialogPro.git") , and it still doesn't work.

@fengdai
Copy link
Owner

fengdai commented Jan 8, 2015

I think the build tools configuration of the library is correct. I also tried to import it using this git URL: "https://github.com/fengdai/AlertDialogPro.git". And it works...

@AndroidDeveloperLB
Copy link
Author

Do you have an idea why it occurs? I will check it at home too (doesn't work at the office, not sure about it at home).

@AndroidDeveloperLB
Copy link
Author

I have this issue at my house too.
I got this dialog when trying to run the sample, even though I didn't interfere with what it wanted to do:
untitled20150108202623
When I choose no, I get this:
untitled20150108201703

No matter what I choose for any of the phases, I get the same error. How could it be?

@fengdai
Copy link
Owner

fengdai commented Jan 9, 2015

You suggest you to try VM4's answer:

If this is happenning to you after switching to compileSdkVersion 21 make sure you use buildToolsVersion "21.0.2" (or later), not "21.0.1".

How to do that:

  1. Open ${Project Root}/gradle.properties
  2. Change property ANDROID_BUILD_TOOLS_VERSION from 21.0.0 to 21.1.2(the latest).
  3. Rebuild project

Try it. Since I don't have this problem, I don't know whether it can solve this problem... If it does, tell me. I'll update my code.

@AndroidDeveloperLB
Copy link
Author

@fengdai This time it worked. Please do it officially for the library itself.
I don't get why Android Studio works this way. If I install the latest build tools, it should use it since it's better than the previous ones (plus why would I want to have others installed).
This example shows that compatibility (which is probably why this feature exists) wasn't achieved.

fengdai added a commit that referenced this issue Jan 9, 2015
@fengdai
Copy link
Owner

fengdai commented Jan 9, 2015

Fixed.

@fengdai fengdai closed this as completed Jan 9, 2015
@AndroidDeveloperLB
Copy link
Author

Thank you. You're the best.
How did you find the solution to the problem? Do you have other tips for Android Studio of how to import correctly libraries ?

@fengdai
Copy link
Owner

fengdai commented Jan 9, 2015

I found the solution with StackOverFlow:
http://stackoverflow.com/questions/21645961/android-studio-processdebugresources-failed/21648362#21648362

Be honest, I'm a Gradle noob and also a beginner of Android Studio...

@AndroidDeveloperLB
Copy link
Author

Oh, ok. Thank you.

@AndroidDeveloperLB
Copy link
Author

Say, how did you create a Gradle repository ? One that lets the developers just put a single like of code in the dependencies to use your library?

@fengdai
Copy link
Owner

fengdai commented Jan 9, 2015

I published it to Maven Central repository. You can Google "publish Maven" to learn how to do this.

@AndroidDeveloperLB
Copy link
Author

OK thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants