Android Compile Error Solutions

本文介绍了解决在Linux环境下编译时遇到的uio.h文件中struct iovec类型重复定义的问题。提供了两种解决方案:一是通过设置LOCAL_CFLAGS变量,二是设置APP_CPPFLAGS变量,并给出了具体的配置示例。

 

1. stuct iovec redefinition of uio.h

Problem: linux/uio.h:18:8: error: redefinition of 'struct iovec'

Solution: Add -DHAVE_SYS_UIO_H to LOCAL_CFLAGS

               or APP_CPPFLAGS

example:

LOCAL_CFLAGS += -DHAVE_SYS_UIO_H

or

APP_CPPFLAGS := -fno-rtti
APP_CPPFLAGS += -fexceptions -DHAVE_SYS_UIO_H

WARNING: A restricted method in java.lang.System has been called WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/D:/Environment/apache-maven-3.8.8/lib/jansi-2.4.0.jar) WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module WARNING: Restricted methods will be blocked in a future release unless native access is enabled WARNING: A terminally deprecated method in sun.misc.Unsafe has been called WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/D:/Environment/apache-maven-3.8.8/lib/guava-25.1-android.jar) WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.046 s [INFO] Finished at: 2025-06-13T09:32:08+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException
06-14
WARNING: A restricted method in java.lang.System has been called WARNING: java.lang.System::loadLibrary has been called by org.fusesource.hawtjni.runtime.Library in an unnamed module (file:/B:/apache-maven-3.6.0/lib/jansi-1.17.1.jar) WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module WARNING: Restricted methods will be blocked in a future release unless native access is enabled WARNING: A terminally deprecated method in sun.misc.Unsafe has been called WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/B:/apache-maven-3.6.0/lib/guava-25.1-android.jar) WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release [INFO] Scanning for projects... [INFO] [INFO] --------------------< com.example:stockmanagement >--------------------- [INFO] Building personnel 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ stockmanagement --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered properties files. [INFO] Copying 1 resource [INFO] Copying 7 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ stockmanagement --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 35 source files to C:\Users\14216\Desktop\ckgl\stockmanagement\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /C:/Users/14216/Desktop/ckgl/stockmanagement/src/main/java/com/example/stockmanagement/stockmanagementApplication.java:[3,25] 程序包com.sun.deploy.si不存在 [ERROR] /C:/Users/14216/Desktop/ckgl/stockmanagement/src/main/java/com/example/stockmanagement/stockmanagementApplication.java:[11,27] 程序包SingleInstanceImpl不存在 [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.651 s [INFO] Finished at: 2025-06-02T20:01:54+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project stockmanagement: Compilation failure: Compilation failure: [ERROR] /C:/Users/14216/Desktop/ckgl/stockmanagement/src/main/java/com/example/stockmanagement/stockmanagementApplication.java:[3,25] 程序包com.sun.deploy.si不存在 [ERROR] /C:/Users/14216/Desktop/ckgl/stockmanagement/src/main/java/com/example/stockmanagement/stockmanagementApplication.java:[11,27] 程序包SingleInstanceImpl不存在 [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 进程已结束,退出代码1 怎么解决
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值