Category Archives: Android Studio

683 views

How rebuild only one module in project Android Studio

If you do click on Rebuid project menu item, this operation maybe consume long time on slovly PC. Some errors dismis when you do rebuild project, or module. Try this: Select module where contains red error code and press Debugg … Continue reading

Posted in Android Studio, Bugs, warnings, errors | Comments Off on How rebuild only one module in project Android Studio
644 views

Android Studio gradle file comment same as java comment

// single line /* multi line */

Posted in Android Examples Code, Android Studio | Comments Off on Android Studio gradle file comment same as java comment
672 views

Save Instance State if device is rotated

Try this trick. In AndroidManifest – activity tag write this code android:configChanges=”keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize” App hold data of a views if will to rotation of device. <activity android:name=".Tests_Activity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

Posted in Android Examples Code, Android Studio | Tagged | Comments Off on Save Instance State if device is rotated
872 views

Resources NotFoundException: File res/drawable/abc_btn_radio_on_mtrl.xml

If you make a new RadioButton and gradle istruction have compile ‘com.android.support:appcompat-v7:23.2.0′ try to change RadioButton into AppCompatRadioButton (context); RadioButton rb = new AppCompatRadioButton (context);

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on Resources NotFoundException: File res/drawable/abc_btn_radio_on_mtrl.xml
1,963 views

No executable code found at line – omits breakpoints

No executable code found at line …. Try one from this solution: 1.) uninstall app from test device, try to debugg app or 2.) open module gradle file and set minifyEnabled to false in debug condition debug { minifyEnabled false … Continue reading

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on No executable code found at line – omits breakpoints
756 views

Interstitial ads admob onCreate Android example code

private InterstitialAd mInterstitialAd; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);     //Caused by: java.lang.IllegalStateException: The ad unit ID must be set on InterstitialAd before loadAd is called. mInterstitialAd = new InterstitialAd(this); mInterstitialAd.setAdUnitId("ca-app-pub-3940256099942544/1033173712"); // Put your number!!!!   // some … Continue reading

Posted in Android Examples Code, Android Studio | Comments Off on Interstitial ads admob onCreate Android example code
765 views

Proguard Android Studio

http://developer.android.com/tools/help/proguard.html If make signed apk, open file build.gradle in the module folder. Set minifyEnabled to true http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Running-ProGuard buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile(’proguard-android.txt’), ‘proguard-rules.pro’ } } Check if the file exists in the module folder proguard-rules.pro c:\Users\meFolder\AndroidStudioProjects\MyProject\myModule\proguard-rules.pro Android … Continue reading

Posted in Android Studio | Tagged | Comments Off on Proguard Android Studio
578 views

Imported module not visible in project explorer Android Studio

Imported module not visible in project explorer Android Studio but exist in project folder. Gradle sync failed: Cause: failed to find target with hash string ‘android-20′ in: C:\Users\jas\AppData\Local\Android\sdk android-20 is for example! Open file in existing module named build.gradle is … Continue reading

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on Imported module not visible in project explorer Android Studio
665 views

Resource Entry already defined

Check if in drawable folder have two picture with same name and delete one. For example: image_1.jpg image_1.png Check the module build folder in Android Studio for two files with same names. C:\Users\myFolder\AndroidStudioProjects\Project\yourModule\build\intermediates\res\merged\debug\drawable\

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on Resource Entry already defined
5,867 views

No USB devices or running detected

Check is sett debug mode on device? enabled debugging over USB? is device right connected? have you downloaded and instaled drivers for your device on PC? For Windows http://developer.android.com/sdk/win-usb.html try disconnect and connect USB cable try do restart Android Studio

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on No USB devices or running detected