android 9 源码编译错误 error: cannot find symbol import android.os.UpdateEngine

今天导入UpdateEngine包,编译的时候报错:

vendor/nxp-opensource/fsl_imx_demo/NaLongUpgrade/app/src/main/java/com/mile8/nalongupgrade/MainActivity.java:9: error: cannot find symbol
import android.os.UpdateEngine;
                 ^
  symbol:   class UpdateEngine
  location: package android.os
vendor/nxp-opensource/fsl_imx_demo/NaLongUpgrade/app/src/main/java/com/mile8/nalongupgrade/MainActivity.java:23: error: cannot find symbol
	private UpdateEngine ue;
	        ^
  symbol:   class UpdateEngine
  location: class MainActivity
2 errors
ninja: build stopped: subcommand failed.
09:41:17 ninja failed with: exit status 1

查度娘,说是  删除Android.mk中的LOCAL_SDK_VERSION := current

 

这样弄后报错:

vendor/nxp-opensource/fsl_imx_demo/NaLongUpgrade/Android.mk: error: NaLongUpgrade: Must specify LOCAL_SDK_VERSION or LOCAL_PRIVATE_PLATFORM_APIS, 
build/make/core/sdk_check.mk:21: error: done.
09:49:19 ckati failed with: exit status 1

#### failed to build some targets (21 seconds) ####

对比源码里面另一个app工程的mk文件,发现将 LOCAL_SDK_VERSION 更改为 LOCAL_PRIVATE_PLATFORM_APIS :

# LOCAL_SDK_VERSION := current
LOCAL_PRIVATE_PLATFORM_APIS := current

 编译通过

 

参考:

https://blog.csdn.net/jsonz/article/details/41117593

你可能感兴趣的:(android1)