gpt4 book ai didi

java - 错误 : Access denied finding property "ro.serialno" in Android Studio

转载 作者:行者123 更新时间:2023-12-04 23:50:35 27 4
gpt4 key购买 nike

我在 Android Studio 中编写了一个 java 代码,通过单击按钮从 Internet 下载和显示图像。它显示错误

E/libc: Access denied finding property "ro.serialno"



Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it!


日志:
E/libc: Access denied finding property "ro.serialno"**
W/wnloadingimages: type=1400 audit(0.0:36): avc: denied { read } for name="u:object_r:serialno_prop:s0" dev="tmpfs" ino=7213 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:serialno_prop:s0 tclass=file permissive=0
V/StudioTransport: Agent command stream started.
V/StudioTransport: JNIEnv not attached
V/StudioProfiler: Memory control stream started.
V/StudioProfiler: Transformed class: android/os/PowerManager
Transformed class: android/app/IntentService
Transformed class: android/app/AlarmManager$ListenerWrapper
V/StudioProfiler: Transformed class: android/os/PowerManager$WakeLock
V/StudioProfiler: Transformed class: android/app/Instrumentation
V/StudioProfiler: Transformed class: android/location/LocationManager$ListenerTransport
Transformed class: android/app/JobSchedulerImpl
V/StudioProfiler: Transformed class: android/app/job/JobServiceEngine$JobHandler
V/StudioProfiler: Transformed class: android/app/ActivityThread
V/StudioProfiler: Transformed class: android/os/Debug
V/StudioProfiler: Transformed class: android/app/AlarmManager
Transformed class: android/app/job/JobService
V/StudioProfiler: Transformed class: android/app/PendingIntent
V/StudioProfiler: Transformed class: android/location/LocationManager
V/StudioProfiler: Transformed class: java/net/URL
**W/zygote: Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it!
我的整个代码:
package com.example.downloadingimages;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class MainActivity extends AppCompatActivity {
ImageView image1;
public void downloadImage(View view) {
Log.i("Info", "Button Tapped");
imageDownloader task = new imageDownloader();
Bitmap myImage;
try {
myImage = task.execute("https://th.bing.com/th/id/OIP.Djjwf_HTzjvMpkRpHdfpwwHaJ7?w=200&h=269&c=7&o=5&dpr=1.5&pid=1.7").get();
image1.setImageBitmap(myImage);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
image1 = findViewById(R.id.imageView);
}

public class imageDownloader extends AsyncTask<String, Void, Bitmap> {

@Override
protected Bitmap doInBackground(String... urls) {
try {
URL url = new URL(urls[0]);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.connect();
InputStream in = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(in);
return myBitmap;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
}

最佳答案

这不是您的代码中的错误。你可以忽略它。

关于java - 错误 : Access denied finding property "ro.serialno" in Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68265794/

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