Where is the R.java file in Android Studio?

前端 未结 11 781
暖寄归人
暖寄归人 2020-12-04 19:24

Where is the R.java file in Android Studio? Can someone please help with this? I already tried google for the answer but can\'t find any solution.

相关标签:
11条回答
  • 2020-12-04 19:58

    R.java is the generated file by ADT or Android studio. It will be located under app\build\generated\source\r directory.

    ./app/build/generated/source/r/debug/android/support/v7/appcompat/R.java
    ./app/build/generated/source/r/debug/your/packagename/name/R.java
    
    0 讨论(0)
  • 2020-12-04 20:02
    1. In my project in Android Studio 4.1

    2. R.jar that you can actually unzip resides in app build folder, as follows:

      jar -xf R.jar

    1. Once the jar is unpacked you can find R.java inside of app package:
    0 讨论(0)
  • 2020-12-04 20:03

    Project/app/build/generated/source/r/debug/com.android.'projectname'/R.java

    0 讨论(0)
  • 2020-12-04 20:04

    I use Android Studio 3.3.2

    \app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\android\support\constraint\R.java
    

    enter image description here

    0 讨论(0)
  • 2020-12-04 20:12

    I am using Android Studio 2.2.3 , the R.java file is shown in the picture below. Goto in the left upper side there is a selecting list ,

    1. select [package]
    2. Open "App Folder"
    3. com.example.saeedanwar.myapplication;
    4. r

    screenshot

    0 讨论(0)
  • 2020-12-04 20:16

    As noted above, "The new Android Gradle Plugin generates the corresponding bytecode directly and does not make the intermediate R.java file".

    Using the ubuntudroid solution you can find an id also this way. Find R.txt and copy absolute path. Project > app > build > intermediates > runtime_symbol_list > debug > R.txt. Then right click and select Copy Path..., 1. Absolute Path Ctrl+Shift+C.

    This way you will obtain a path to R.txt, for instance, "C:\Users\user\AndroidStudioProjects\your_project\app\build\intermediates\runtime_symbol_list\debug\R.txt". Copy the path without R.txt to a text file for future references, for example, with Notepad++.

    Press Ctrl+Shift+F to find in directory. Insert an id and the path.

    == Old answer ==

    Change a project view from Android to Project or Project Files. Find one of these two files.

    Then you can revert back to Android view.

    0 讨论(0)
提交回复
热议问题