I'm starting a simple app to send an SMS at the press of a button. I'm testing this on my mobile phone since i need the network. The app build fine the first time but the button press didn't do anything since i forgot to add the permission android.permission.SEND_SMS
. Once i added that then faced with following error.
Error:java.io.FileNotFoundException: C:\Users\user\AndroidStudioProjects\myApp\app\build\intermediates\res\resources-debug.ap_ (Access is denied)
C:\Users\user\AndroidStudioProjects\myApp\app\build\intermediates\res\resources-debug.ap_ (Access is denied)
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.android.myapp">
<uses-permission android:name="android.permission.SEND_SMS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
If I delete the uses-permission
tag the app builds without a problem. But when I add it it fails. Any assistance would be greatly appreciated!
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.test.android.myapp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
}