Rectangle 27 20

This issue can also come up if you have a space anywhere in your Android SDK path. The solution is to modify $ANDROID_SDK\tools\proguard\bin\proguard.sh. Change this last line:

java -jar $PROGUARD_HOME/lib/proguard.jar "$@"
java -jar "$PROGUARD_HOME/lib/proguard.jar" "$@"

This is what solved my issue with the default Android Studio/ProGuard setup on OSX.

while you are at it, you should modify proguardgui.sh and retrace.sh in the same directory as well

This worked, in my case when Android Studio installed, it installed as "Android Studio.app" (note the space) Now onto more ProGuard Hell, as it can't locate references.

1+ I switched my eclipse from 32bit to 64bit ubuntu and faced the same issue. But the above resolved it. Thanks :)

Android ProGuard Unable to access jarfile ..\lib\proguard.jar in Intel...

android intellij-idea proguard
Rectangle 27 119

Found the solution to this problem:

gradle assemble -info gave me the hint that the Manifests have different SDK Versions and cannot be merged.

uses-sdk
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" />
android
minSdkVersion
targetSdkVersion
android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 16
    }
}

Make sure you edit your gradle.build file on the case you're using Android Studio. Values on AndroidManifest.xml are overriden during build!

@Nakardo changing the values in build.gradle do not override the values on my AndroidManifest.xml when executing gradle assemble

@Nakardo The build.gradle sdkVersion always override the AndroidManifest.xml Android docs quote: This minSdkVersion value is not used; it is always overridden by the value specified in the Gradle build script The value of (for example) minSdkVersion is only used if it is not specified in the build.gradle build scripts. When specified in the Gradle build scripts, the manifest value is ignored and can be misleading, so should be removed to avoid ambiguity.

@Lukas Olsen spot on solution. My minsdk version was 19 but in gradle it was 10, still not needed for targetSDK in build.gradle although its declared in the manifest. Interestingly, I just updated my android studio to 2.1.1 and it was working previously. Problem fixed now.

As a follow up, the error returned actually because I had a duplicated meta data tag pulling the application ID from strings.xml for use with parse. No parse related errors but that meta data caused the crash, I actually didnt see this error detail until I opened the gradle console tab in android studio v. 2.1.1

android - Gradle: Execution failed for task ':processDebugManifest' - ...

android gradle android-studio build.gradle
Rectangle 27 93

I installed the new ADT (v. 22). It stopped creating gen folder which includes R.java. The solution was to also install new Android SDK Build Tools from Android SDK Manager.

Myself also. And when I selected the SDK manager, lo and behold, the build tools shows up auto-checked for installing, with a note that it wasn't installed! What gives???

I had the same issue. I'm so glad you shared this. I looked error from my own code two days. I'm very diappointed to Google, because this error message has been very difficult to solve, but it has been caused by own error, allthough tools dis not report properly what causes it. I has done same time changes to my project so I thinked it was my fault again.

i was hanging around for looking for the answer but nothing worked for me. i think it was a eclipse or sdk problem. so as you are saying, i just delete prev eclipse bundle and reinstall it. and then it is working. your answer was helped

This was the problem in my case! Wasted one day trying to fix the R error, adding/removing references, and trying other options. Mine was a fresh new setup of ADT, and a new android project creation, and was still getting the error. It turned out finally, I had to install all available updates of Android SDK Tools, Android SDK Platform Tools and SDK Build Tools :p

eclipse - R cannot be resolved - Android error - Stack Overflow

android eclipse compiler-errors android-resources android-sdk-tools
Rectangle 27 93

I installed the new ADT (v. 22). It stopped creating gen folder which includes R.java. The solution was to also install new Android SDK Build Tools from Android SDK Manager.

Myself also. And when I selected the SDK manager, lo and behold, the build tools shows up auto-checked for installing, with a note that it wasn't installed! What gives???

I had the same issue. I'm so glad you shared this. I looked error from my own code two days. I'm very diappointed to Google, because this error message has been very difficult to solve, but it has been caused by own error, allthough tools dis not report properly what causes it. I has done same time changes to my project so I thinked it was my fault again.

i was hanging around for looking for the answer but nothing worked for me. i think it was a eclipse or sdk problem. so as you are saying, i just delete prev eclipse bundle and reinstall it. and then it is working. your answer was helped

This was the problem in my case! Wasted one day trying to fix the R error, adding/removing references, and trying other options. Mine was a fresh new setup of ADT, and a new android project creation, and was still getting the error. It turned out finally, I had to install all available updates of Android SDK Tools, Android SDK Platform Tools and SDK Build Tools :p

eclipse - R cannot be resolved - Android error - Stack Overflow

android eclipse compiler-errors android-resources android-sdk-tools
Rectangle 27 93

I installed the new ADT (v. 22). It stopped creating gen folder which includes R.java. The solution was to also install new Android SDK Build Tools from Android SDK Manager.

Myself also. And when I selected the SDK manager, lo and behold, the build tools shows up auto-checked for installing, with a note that it wasn't installed! What gives???

I had the same issue. I'm so glad you shared this. I looked error from my own code two days. I'm very diappointed to Google, because this error message has been very difficult to solve, but it has been caused by own error, allthough tools dis not report properly what causes it. I has done same time changes to my project so I thinked it was my fault again.

i was hanging around for looking for the answer but nothing worked for me. i think it was a eclipse or sdk problem. so as you are saying, i just delete prev eclipse bundle and reinstall it. and then it is working. your answer was helped

This was the problem in my case! Wasted one day trying to fix the R error, adding/removing references, and trying other options. Mine was a fresh new setup of ADT, and a new android project creation, and was still getting the error. It turned out finally, I had to install all available updates of Android SDK Tools, Android SDK Platform Tools and SDK Build Tools :p

eclipse - R cannot be resolved - Android error - Stack Overflow

android eclipse compiler-errors android-resources android-sdk-tools
Rectangle 27 69

Try this solution and it worked. this problem is caused because ADB is unable to connect to the android servers to fetch updates. (If at home try turning off firewall)

  • Click Settings - Will be asked for a proxy.
  • If have one enter the IP address and the port number. If not turn off your firewall.
  • Check "Force https://... " (to force SDK Manager to use http, not https)

This should work immediately.

@dubayya : Inside Internet explorer, Press Alt+t -> Select Internet Options -> Select connections tab -> Click Lan settings. You can see Proxy settings there. Address and Port Number need to be updated for this particular problem.

Android SDK Manager gives "Failed to fetch URL https://dl-ssl.google.c...

android android-2.2-froyo avd
Rectangle 27 9

This problem is caused by blank spaces in the path you setup in the Android SDK. The solution is that you should move the folder of the Android SDK to a place without spaces, in your case:

E:\andriod-sdk-windows
D:\abc\xyz\android-sdk-windows

Thank you Hung Tran. I changed the path name to remove the space by using PROGRA~1 instead of PROGRAM FILES as suggested in another link and it works now.

How does that work when you use visual studio?? with monotouch?

Android Emulator - invalid command-line parameter: - Stack Overflow

android-emulator
Rectangle 27 103

Like you I also faced many problems implementing OCR in Android, but after much Googling I found the solution, and it surely is the best example of OCR.

Import all three projects. After importing you will get an error. To solve the error you have to create a res folder in the tess-two project

After doing this in all three project the error should be gone.

Now download the source code from https://github.com/rmtheis/android-ocr, here you will get best example.

Now you just need to import it into your workspace, but first you have to download android-ndk from this site:

Now open cmd and go to on D:\Android Workspace\tess-two like below

If you have successfully set up environment variable of NDK then just type ndk-build just like above picture than enter you will not get any kind of error and all file will be compiled successfully:

Now download other source code also from https://github.com/rmtheis/tess-two , and extract and import it and give it name OCRTest, like in my PC which is in D:\Android Workspace\OCRTest

Import test-two in this and run OCRTest and run it; you will get the best example of OCR.

@Siddhpura I am getting the following error java.lang.ExceptionInInitializerError at edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:711)

@Shink I got the same error, how did you resolve it?

hi i have successfully configured the project , but with OCRTest app while capturing and returned string is not correct plz help me ....

best OCR (Optical character recognition) example in android - Stack Ov...

android ocr tesseract
Rectangle 27 103

Like you I also faced many problems implementing OCR in Android, but after much Googling I found the solution, and it surely is the best example of OCR.

Import all three projects. After importing you will get an error. To solve the error you have to create a res folder in the tess-two project

After doing this in all three project the error should be gone.

Now download the source code from https://github.com/rmtheis/android-ocr, here you will get best example.

Now you just need to import it into your workspace, but first you have to download android-ndk from this site:

Now open cmd and go to on D:\Android Workspace\tess-two like below

If you have successfully set up environment variable of NDK then just type ndk-build just like above picture than enter you will not get any kind of error and all file will be compiled successfully:

Now download other source code also from https://github.com/rmtheis/tess-two , and extract and import it and give it name OCRTest, like in my PC which is in D:\Android Workspace\OCRTest

Import test-two in this and run OCRTest and run it; you will get the best example of OCR.

@Siddhpura I am getting the following error java.lang.ExceptionInInitializerError at edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:711)

@Shink I got the same error, how did you resolve it?

hi i have successfully configured the project , but with OCRTest app while capturing and returned string is not correct plz help me ....

best OCR (Optical character recognition) example in android - Stack Ov...

android ocr tesseract
Rectangle 27 5

I got this problem just now, and I found a solution.

My path to the emulator-arm.exe is C:\Program Files\Android\android-sdk\tools. When I try emulator-arm @my_avd from the command line (my_avd is my Android Virtual Device name), it works.

Starting the Android emulator in SDK tools, revision 12 - Stack Overfl...

android android-emulator android-sdk-tools
Rectangle 27 5

I got this problem just now, and I found a solution.

My path to the emulator-arm.exe is C:\Program Files\Android\android-sdk\tools. When I try emulator-arm @my_avd from the command line (my_avd is my Android Virtual Device name), it works.

Starting the Android emulator in SDK tools, revision 12 - Stack Overfl...

android android-emulator android-sdk-tools
Rectangle 27 16

Your question is to the point, and I have failed to address it in my solution. As far as I can tell the solution I've found works only dynamically, where you can choose your activity while calling the sdk...

The reason my code does not have a use example, is because my solution is a bit more complicated then the one I presented, involving an entire wrapping framework I've build around the Android framework, where the AdMob relation to the application is via an intermediate module, which puts the ad dynamically using the single activity instance.

I really doubt you can avoid the memory leak simply using the Android XML.

In any case, if you are into the memory leak business, you might as well check out your AsyncTask usage... it also has its own memory leak behavior... so here is my solution

Someone just upvoted my answer, its propustorase that this issue still exists, it has been almost three years since my original answer, and people still have memory leaks in their apps because of AdMob... from Google... that made Android....

Anyway, I just wanted to add that you should probably set the theme of the AdMobActivity to transparent, it would prevent the flickering.

Five years... Someone at Google please wake up, and hire real monkey to do the job :)

Thanks Adam! Please see my edited post for a more direct question. Thanks for also pointing out the AsyncTask issue. I have thankfully not run into it yet or if I have, it hasn't been a huge leak like AdMob.

Which AdMob version you use? Did you call it before or after the super.onCreate(...)? In which activity do you instantiate the AdView, the Dummy Activity, or the real UI Activity.

I got it working. See edits in original question for the details. Thanks so much!

The problem is still there with Google Play Services 7.0 AdMob SDK and this solution does not work for me. If you found any other solution recently, please share it :| stackoverflow.com/questions/29252545/

android - Admob Memory Leak - avoiding by using empty activity - Stack...

android memory-leaks admob
Rectangle 27 13

The simplest solution I have found is this:

  • Try and access Facebook with the Android SDK
  • Look for the line in the log that looks like this: 04-24 01:14:08.605: I/System.out(31395): invalid_key:Android key mismatch. Your key "abcdefgHIJKLMN+OPqrstuvwzyz" does not match the allowed keys specified in your application settings. Check your application settings at http://www.facebook.com/developers

Copy "abcdefgHIJKLMN+OPqrstuvwzyz" and paste it into the Facebook Android Key Hash area.

windows - Key hash for Android-Facebook app - Stack Overflow

android windows facebook
Rectangle 27 10

I found a solution:

Firstly, using MageUI, I changed the "Start Location" under "Deployment Options". On saving, it prompted me to sign with a key, which I created there and then. I then ran the setup.exe file, and it worked without fail.

After checking which files had changed, I realised it was only the one file: the application manifest file (myAppName.application). The only things that changed in the file were the deployment provider and the signature (which is what I changed in MageUI).

Once I realised this was how to do it, I used the command line version of MageUI called Mage.exe, which comes with the SDK.

Below is the batch file I created to do all of this on the command line:

REM Set the enviroment call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"

REM Update the deployment provider URL mage -Update %1.application -pu %2

REM Sign the manifest with our key mage -Sign %1.application -CertFile C:\AppKey.pfx -Password myPw

I can now use this to run against all of my published applications in a quick and easy way. I hope this helps.

c# - How to move a ClickOnce deployment package - Stack Overflow

c# clickonce manifest
Rectangle 27 3

I found the solution on how to Revoke a User's Permission in the latest version of Facebook Android SDK (Graph API 2.0+ and above). This is per May 2015. The developer needs to use GraphRequest.newGraphPathRequest() and set the GraphPath and set the HttpMethod to DELETE.

public void graphRevokeUserStatusPermission(){
        AccessToken accessToken = AccessToken.getCurrentAccessToken();
        if(accessToken == null)
            return;

        GraphRequest request = GraphRequest.newGraphPathRequest(
                accessToken,
                "/me/permissions/user_status",
                new GraphRequest.Callback() {
                    @Override
                    public void onCompleted(GraphResponse response) {
                        // response
                    }
                }
        );
        request.setHttpMethod(HttpMethod.DELETE);
        request.executeAsync();
    }

and if you want to revoke user access just change graph path to

String userId = accessToken.getUserId();
    //url to revoke login DELETE {user_id}/permissions
    userId + "permissions"

and don't forget to clear info in onCompleted method calling LoginManager.getInstance().logOut(), this logout method doesn't revoke access, it just clear token and profile info, so developer needs to request url to revoke access

@Jhonatas (via suggested edit): You probably should post that as a separate answer.

it does work perfect. in my case I use the graphPath "/me/permissions" then delete all, next time whne the user login it ask for permission all again. it is uselful for testing. thank for you answer

How to revoke specific (or all) user permissions in Android for Facebo...

android facebook facebook-graph-api facebook-login facebook-android-sdk
Rectangle 27 9

I found the solution, Problem started when I updated sdk, after that I used different buildToolsVersion ('22.0.1') and I was using different support library like compile 'com.android.support:appcompat-v7:23.0.0', showing you in image below

This was raising problem of "android.widget.Material..." Then I used same version for support library like compile 'com.android.support:appcompat-v7:22.0.1' and its DONE. (Showing you in below screenshot)

android - Error retrieving parent for item: No resource found that mat...

android android-studio gradle
Rectangle 27 3

You likely don't want to use FORCE_DIALOG_AUTH as the solution because this disables the very useful Single Sign On feature completely. Instead, if you go through the steps of setting up your application properly with Facebook, that should address the invalid_key issues. You can find a detailed explanation of this on my blog:

How to disable Facebook single sign on for android - Facebook-android-...

android facebook sdk single-sign-on
Rectangle 27 6

I had the same problem with my IntelliJ Maven build. My "solution" was to go into the build tools and remove the build tools 24.0.0 folder. I found it in the {android-sdk-location}/build-tools/ directory. This is not a long term fix, but this should at least get your project building again. Upgrading to Java 8 as many have suggested will be better long term.

This is the first option that I could actually use, because I couldn't find the settings mentioned in other answers in Android Studio's UI. I deleted it and then created a new project and it worked.

java - Unsupported major.minor version 52.0 in my app - Stack Overflow

java android maven-plugin
Rectangle 27 2

This solution worked for me using the android sdk v19:

//get the image button by id
ImageButton myImg = (ImageButton) findViewById(R.id.some_id);

//get drawable from image button
GradientDrawable drawable = (GradientDrawable) myImg.getDrawable();

//set color as integer
//can use Color.parseColor(color) if color is a string
drawable.setColor(color)

android - How to change shape color dynamically? - Stack Overflow

android android-layout xamarin.android shape
Rectangle 27 2

This solution worked for me using the android sdk v19:

//get the image button by id
ImageButton myImg = (ImageButton) findViewById(R.id.some_id);

//get drawable from image button
GradientDrawable drawable = (GradientDrawable) myImg.getDrawable();

//set color as integer
//can use Color.parseColor(color) if color is a string
drawable.setColor(color)

android - How to change shape color dynamically? - Stack Overflow

android android-layout xamarin.android shape