"R." The layout using, is the code given below which gives this error.
But if I select "Compile" with "Ample 19", then this code works fine. I want to run my code on my mobile which is 2.3.3.
I searched on Google I found out that many people were on this issue but no solution works for me
package com.example.testfor23; Import android.support.v7.app.ActionBarActivity; Import android.support.v7.app.ActionBar; Import android.support.v4.app.Fragment; Importroid.os.Bundle; Import android.view.LayoutInflater; Import android.view.Menu; Import android.view.MenuItem; Import android.view.View; Import android.view.ViewGroup; Import android.os.build; Public Class Main Activity ActionBarActivity Expanded {@ Override Protected Zero (Bundle Saved Instance) {super.onCreate (SavedInstanceState); SetContentView (R.layout.activity_main); If (savedInstanceState == zero) {getSupportFragmentManager () BeginTransaction () .add (R.id.container, new placeholder fragment ()) .commit (); }}}
Below is a clear file
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Manifest xmlns: Android = "http://schemas.android.com/apk/res/android" package = "com.example.testfor231" Android: versionCode = "1" Android: versionName = "1.0" & gt; & Lt; Use-sdk android: minSdkVersion = "7" Android: targetSdkVersion = "19" /> & Lt; Application Android: allowBackup = "true" android: icon = "@draubable / ic_luncher" android: label = "@ string / app_name" & gt; & Lt; Activity Android: name = "com.example.testfor231.MainActivity" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;
If I choose "compileSdkVersion 19" then it works perfectly well.
android {compileSdkVersion 10 buildToolsVersion "19.0.1" default config {minSdkVersion 9 targetSdkVersion 9} Sometimes this happens because there may be errors in your XML, and this syntax error, resources that are not compatible try to not duplicate in the res-directory, Also import r from your project, sometimes This error occurs because you have imported (in this case)
import Com.aksamplektestfor23kr;
Because if you do not import it, then you are talking to the resource from the platform.
Comments
Post a Comment