当我尝试使用名为" ClubInternetLives"的虚拟应用程序构建android棒棒糖ROM时,我看到以下错误。
target Dex: SoundRecorder target Dex: CaptivePortalLogin target Dex: CertInstaller target Java: ClubInternetLives (out/target/common/obj/APPS/ClubInternetLives_intermediates/classes) target Dex: DownloadProviderUi target Dex: HTMLViewer packages/apps/ClubInternetLives/app/src/androidTest/java/clubinternetlives/androidstudio/com/clubinternetlives/ApplicationTest.java:4: error: cannot find symbol import android.test.ApplicationTestCase; ^ symbol: class ApplicationTestCase location: package android.test packages/apps/ClubInternetLives/app/src/androidTest/java/clubinternetlives/androidstudio/com/clubinternetlives/ApplicationTest.java:9: error: cannot find symbol public class ApplicationTest extends ApplicationTestCase { ^ symbol: class ApplicationTestCase packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:4: error: package android.support.design.widget does not exist import android.support.design.widget.FloatingActionButton; ^ packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:5: error: package android.support.design.widget does not exist import android.support.design.widget.Snackbar; ^ packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:6: error: package android.support.v7.app does not exist import android.support.v7.app.AppCompatActivity; ^ packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:7: error: package android.support.v7.widget does not exist import android.support.v7.widget.Toolbar; ^ packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:12: error: cannot find symbol public class MainActivity extends AppCompatActivity { ^ symbol: class AppCompatActivity packages/apps/ClubInternetLives/app/src/test/java/clubinternetlives/androidstudio/com/clubinternetlives/ExampleUnitTest.java:3: error: package org.junit does not exist import org.junit.Test; ^ packages/apps/ClubInternetLives/app/src/test/java/clubinternetlives/androidstudio/com/clubinternetlives/ExampleUnitTest.java:5: error: package org.junit does not exist import static org.junit.Assert.*; ^ packages/apps/ClubInternetLives/app/src/test/java/clubinternetlives/androidstudio/com/clubinternetlives/ExampleUnitTest.java:11: error: cannot find symbol @Test ^ symbol: class Test location: class ExampleUnitTest target Dex: KeyChain packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:16: error: cannot find symbol super.onCreate(savedInstanceState); ^ symbol: variable super location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:17: error: cannot find symbol setContentView(R.layout.activity_main); ^ symbol: method setContentView(int) location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:18: error: cannot find symbol Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); ^ symbol: class Toolbar location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:18: error: cannot find symbol Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); ^ symbol: class Toolbar location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:18: error: cannot find symbol Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); ^ symbol: method findViewById(int) location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:21: error: cannot find symbol FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); ^ symbol: class FloatingActionButton location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:21: error: cannot find symbol FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); ^ symbol: class FloatingActionButton location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:21: error: cannot find symbol FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); ^ symbol: method findViewById(int) location: class MainActivity Proguard: out/target/common/obj/APPS/LiveWallpapers_intermediates/proguard.classes.jar packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:25: error: cannot find symbol Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) ^ symbol: variable Snackbar packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:25: error: cannot find symbol Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) ^ symbol: variable Snackbar packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:14: error: method does not override or implement a method from a supertype @Override ^ packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:34: error: cannot find symbol getMenuInflater().inflate(R.menu.menu_main, menu); ^ symbol: method getMenuInflater() location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:31: error: method does not override or implement a method from a supertype @Override ^ packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:50: error: cannot find symbol return super.onOptionsItemSelected(item); ^ symbol: variable super location: class MainActivity packages/apps/ClubInternetLives/app/src/main/java/clubinternetlives/androidstudio/com/clubinternetlives/MainActivity.java:38: error: method does not override or implement a method from a supertype @Override ^ packages/apps/ClubInternetLives/app/src/test/java/clubinternetlives/androidstudio/com/clubinternetlives/ExampleUnitTest.java:13: error: cannot find symbol assertEquals(4, 2 + 2); ^ symbol: method assertEquals(int,int) location: class ExampleUnitTest 26 errors make: *** [out/target/common/obj/APPS/ClubInternetLives_intermediates/classes-full-debug.jar] Error 41 make: *** Waiting for unfinished jobs.... ProGuard, version 4.10 Reading program jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/APPS/LiveWallpapers_intermediates/classes.jar] Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar] Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar] Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar] Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar] Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Preparing output jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/APPS/LiveWallpapers_intermediates/proguard.classes.jar] Copying resources from program jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/APPS/LiveWallpapers_intermediates/classes.jar] #### make failed to build some targets (01:41 (mm:ss)) ####
该应用程序在android studio上编译并运行,没有任何错误和警告。就ROM设置而言,我已在build / target / product的 core.mk 文件中添加了应用名称。我还在应用程序的主文件夹中添加了一个Android.mk文件。知道这些错误的原因是什么?
答案 0 :(得分:1)
我收到此错误是因为我的应用程序具有由Android工作室创建的预编译的Java代码。从java文件夹中删除这些预编译文件后,这些错误消失了。 ROM编译器具有与Android Studio或Eclipse环境不同的构建环境。