I'm trying to run an open source project in Android Studio 2.0. My problem is that I can't import the class IoBridge (import libcore.io.IoBridge;). The compiler is saying that libcore does not exist. And effectively in my SDK (revision 23) there is not the library named libcore. Below is the code.
/*
* 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
Apparently, that code is designed to built as part of the system firmware, not from an Android SDK app. libcore is not available to Android SDK app developers.
Specifically, based on the screenshot, you appear to be attempting to compile java.net.Socket from the Android Open Source Project, which is not designed to be compiled as part of an Android app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With