Android4.4编译出现checkapi错误及解决办法

昨天上午不知道修改了哪里编译Android系统后出现checkapi错误,发现修改的文件跟API没关系,错误如下:

Checking API: checkapi-last
Checking API: checkapi-current
Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar

frameworks/base/api/current.txt:23573: error 8: Removed public class android.test.ActivityInstrumentationTestCase
frameworks/base/api/current.txt:23580: error 8: Removed public class android.test.ActivityInstrumentationTestCase2
frameworks/base/api/current.txt:23588: error 8: Removed public class android.test.ActivityTestCase
frameworks/base/api/current.txt:23595: error 8: Removed public class android.test.ActivityUnitTestCase
frameworks/base/api/current.txt:23620: error 8: Removed public class android.test.AndroidTestRunner
frameworks/base/api/current.txt:23641: error 8: Removed public class android.test.ApplicationTestCase
frameworks/base/api/current.txt:23650: error 8: Removed public class android.test.AssertionFailedError
frameworks/base/api/current.txt:23655: error 8: Removed public class android.test.ComparisonFailure
frameworks/base/api/current.txt:23675: error 8: Removed public class android.test.InstrumentationTestRunner
frameworks/base/api/current.txt:23701: error 8: Removed public class android.test.IsolatedContext
frameworks/base/api/current.txt:23706: error 8: Removed public class android.test.LoaderTestCase
frameworks/base/api/current.txt:23711: error 8: Removed public class android.test.MoreAsserts
frameworks/base/api/current.txt:23763: error 8: Removed public class android.test.ProviderTestCase
frameworks/base/api/current.txt:23771: error 8: Removed public class android.test.ProviderTestCase2
frameworks/base/api/current.txt:23779: error 8: Removed public class android.test.RenamingDelegatingContext
frameworks/base/api/current.txt:23788: error 8: Removed public class android.test.ServiceTestCase
frameworks/base/api/current.txt:23801: error 8: Removed public class android.test.SingleLaunchActivityTestCase
frameworks/base/api/current.txt:23807: error 8: Removed public class android.test.SyncBaseInstrumentation
frameworks/base/api/current.txt:23813: error 8: Removed public class android.test.TestSuiteProvider
frameworks/base/api/current.txt:23817: error 8: Removed public class android.test.TouchUtils
frameworks/base/api/current.txt:23855: error 8: Removed public class android.test.ViewAsserts
frameworks/base/api/current.txt:23878: error 7: Removed package android.test.mock
frameworks/base/api/current.txt:24123: error 7: Removed package android.test.suitebuilder
frameworks/base/api/current.txt:32792: error 7: Removed package com.android.internal.util

******************************
You have tried to change the API from what has been previously approved.

To make these errors go away, you have two choices:
   1) You can add "@hide" javadoc comments to the methods, etc. listed in the
      errors above.

   2) You can update current.txt by executing the following command:
         make update-api

      To submit the revised current.txt to the main Android repository,
      you will need approval.
******************************

prebuilts/sdk/api/19.txt:23573: error 8: Removed public class android.test.ActivityInstrumentationTestCase
prebuilts/sdk/api/19.txt:23580: error 8: Removed public class android.test.ActivityInstrumentationTestCase2
prebuilts/sdk/api/19.txt:23588: error 8: Removed public class android.test.ActivityTestCase
prebuilts/sdk/api/19.txt:23595: error 8: Removed public class android.test.ActivityUnitTestCase
prebuilts/sdk/api/19.txt:23620: error 8: Removed public class android.test.AndroidTestRunner
prebuilts/sdk/api/19.txt:23641: error 8: Removed public class android.test.ApplicationTestCase
prebuilts/sdk/api/19.txt:23650: error 8: Removed public class android.test.AssertionFailedError
prebuilts/sdk/api/19.txt:23655: error 8: Removed public class android.test.ComparisonFailure
prebuilts/sdk/api/19.txt:23675: error 8: Removed public class android.test.InstrumentationTestRunner
prebuilts/sdk/api/19.txt:23701: error 8: Removed public class android.test.IsolatedContext
prebuilts/sdk/api/19.txt:23706: error 8: Removed public class android.test.LoaderTestCase
prebuilts/sdk/api/19.txt:23711: error 8: Removed public class android.test.MoreAsserts
prebuilts/sdk/api/19.txt:23763: error 8: Removed public class android.test.ProviderTestCase
prebuilts/sdk/api/19.txt:23771: error 8: Removed public class android.test.ProviderTestCase2
prebuilts/sdk/api/19.txt:23779: error 8: Removed public class android.test.RenamingDelegatingContext
prebuilts/sdk/api/19.txt:23788: error 8: Removed public class android.test.ServiceTestCase
prebuilts/sdk/api/19.txt:23801: error 8: Removed public class android.test.SingleLaunchActivityTestCase
prebuilts/sdk/api/19.txt:23807: error 8: Removed public class android.test.SyncBaseInstrumentation
prebuilts/sdk/api/19.txt:23813: error 8: Removed public class android.test.TestSuiteProvider
prebuilts/sdk/api/19.txt:23817: error 8: Removed public class android.test.TouchUtils
prebuilts/sdk/api/19.txt:23855: error 8: Removed public class android.test.ViewAsserts
prebuilts/sdk/api/19.txt:23878: error 7: Removed package android.test.mock
prebuilts/sdk/api/19.txt:24123: error 7: Removed package android.test.suitebuilder
prebuilts/sdk/api/19.txt:32792: error 7: Removed package com.android.internal.util

******************************
You have tried to change the API from what has been previously released in
an SDK.  Please fix the errors listed above.
******************************


make: *** [out/target/common/obj/PACKAGING/checkapi-last-timestamp] Error 38

期间删除out目录重新编译无效,恢复修改的文件,无效,具体是哪里错误已经搞不清楚了....

按照提示先make update-api,然后重新编译,关于current.txt的错误已经没有了,但是19.txt的错误依旧存在

有说是JAVA环境问题,我的是1.6的没问题,为了防止ubuntu自带的openJDK干扰,卸载了openJDK,依然如故....

既然提示说Removed,那就将19.txt中相关定义对比新生成的current.txt对比删掉吧...

然后编译,在忐忑的心情下竟然编译通过了,时间也就到了现在了....

解决过程极其简单,但是解决这个问题的过程却十分繁琐,网上相关问题几乎没有,google上不去....真无语了,但是是什么造成出现这个问题的到现在我还不明白

之前删了一些framework中的test目录,跟这个有关系?但是我恢复了后也没用,而且是前几天删掉了,问题却是昨天才出现.....

有知道该问题的朋友不妨给我留言

你可能感兴趣的:(Android开发,Android移植)