gpt4 book ai didi

java - 无法导入库 libcore.io.IoBridge

转载 作者:行者123 更新时间:2023-11-29 00:04:03 27 4
gpt4 key购买 nike

我正在尝试在 Android Studio 2.0 中运行一个开源项目。我的问题是我无法导入类 IoBridge (import libcore.io.IoBridge;)。编译器说 libcore 不存在。实际上在我的 SDK(修订版 23)中没有名为 libcore 的库。下面是代码。

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package java.net;

import java.io.Closeable;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.channels.SocketChannel;
import libcore.io.IoBridge;

enter image description here

最佳答案

显然,该代码旨在构建为系统固件的一部分,而不是来自 Android SDK 应用。 libcore 不适用于 Android SDK 应用程序开发人员。

具体来说,根据屏幕截图,您似乎试图从 Android 开源项目编译 java.net.Socket,该项目并非设计为作为 Android 应用程序的一部分进行编译。

关于java - 无法导入库 libcore.io.IoBridge,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36915690/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com