Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using IntelliJ coding Android Moduble and I get these three errors trying to build and compile my program
Error:(22, 24) java: cannot find symbol
symbol: variable layout
location: class com.scsvideo.ScSVideo
Error:(26, 47) java: cannot find symbol
symbol: variable id
location: class com.scsvideo.ScSVideo
Error:(27, 89) java: cannot find symbol
symbol: variable raw
location: class com.scsvideo.R
Here is the code:
01
package com.scsvideo;
02

03
import android.app.Activity;
04
import android.net.Uri;
05
import android.os.Bundle;
06
import android.widget.MediaController;
07
import android.widget.Toast;
08
import android.widget.VideoView;
09
import com.scsvideo.*;
10

11

12

13

14
public class ScSVideo extends Activity {
15
private VideoView mVideoView;
16
/**
17
* Called when the activity is first created.
18
*/
19
@Override
20
public void onCreate(Bundle savedInstanceState) {
21
super.onCreate(savedInstanceState);
22
setContentView(layout.main);
23

24
Toast.makeText(getApplicationContext(), "Turn device to side tap screen", Toast.LENGTH_LONG).show();
25

26
mVideoView = (VideoView) findViewById(id.surface_view);
27
mVideoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() +"/"+R.raw.s));
28
mVideoView.setMediaController(new MediaController(this));
29
mVideoView.requestFocus();
30
}
31
}


Now here is the main XML
01

02
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android">03
android:orientation="vertical"
04
android:layout_width="match_parent"
05
android:layout_height="match_parent">
06

07
<VideoView
08
android:id="@+id/surface_view"
09
android:layout_width="fill_parent"
10
android:layout_height="fill_parent"/>
11
12

13
Next Android Manifest XML
14

15
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
16
package="com.scsvideo"
17
android:versionCode="1"
18
android:versionName="1.0">
19
<uses-sdk android:minsdkversion="22">
20
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
21
<activity android:name="ScSVideo">
22
android:label="@string/app_name">
23
<intent-filter>
24
<action android:name="android.intent.action.MAIN">
25
<category android:name="android.intent.category.LAUNCHER">
26

27

28

29


Can someone PLS PLS help me?
Posted
Comments
Richard MacCutchan 4-May-15 4:27am    
Please format your code so it is properly readable, by adding <pre> tags around it.

It may be that your resources have not been built properly, check your project to make sure all components are present and have been successfully compiled. You also need to use the R prefix on resource items.

1 solution

Hello,

As friend above said, please format your code.
For now I can tell you that for example this fragment of your code:

mVideoView = (VideoView) findViewById(id.surface_view);


shoould be like this:

mVideoView = (VideoView) findViewById(R.id.surface_view);


Hope it will somehow help you.
 
Share this answer
 
Comments
Member 11661216 6-May-15 18:25pm    
Yes i did that i still get the Raw cannot be resloved
Do you need to see my Main XML?
<========================>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<textview
="" android:layout_width="fill_parent" android:layout_height="wrap_content">
<Button
android:id="@+id/playvideoplayer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="- PLAY Video-"
/>


<VideoView
android:id="@+id/videoview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>


</LinearLayout>
I have tried everything on StackOverFlow and now on here can u assist me pls tell me what to do next
Member 11661216 6-May-15 18:26pm    
ok

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900