Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
794 views
in Technique[技术] by (71.8m points)

android - E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache Error while using Picasso and okhttp in genymotion

I'm writing an app which loads a picture from a URL and display in an imageview. here is the code...

public class MainActivity extends Activity {

private Picasso picasso;
private OkHttpClient okHttpClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ImageView imageview = (ImageView) findViewById(R.id.imageView);
    String image_url ="http://www.empireonline.com/images/uploaded/wreck-it-ralph-box-office.jpg";



    okHttpClient = new OkHttpClient();
    picasso = new Picasso.Builder(this)
            .downloader(new OkHttpDownloader(okHttpClient))
            .build();
    Context con = getApplicationContext();
    picasso.with(con)
            .load(image_url)
            .placeholder(R.drawable.ic_launcher)
            .resize(60,60)
            .into(imageview);
}

The app doesn't crash but it does not show the picture either! in the LogCat i've got these 2 errors:

09-15 13:17:17.419    2358-2358/**************** E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
09-15 13:17:17.439    2358-2358/**************** E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()

I'm using Genymotion 2.0.1 . Can u plz help me???

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar problem. I solved it by increasing the virtual machine's memory. Default setting in Genymotion is very small.

Open your VirtualBox Manager (NOT Genymotion). Select your desire Android VM and go to Settings / System and change the slider for Base Memory. You can also increase the Video Memory in the Display tab.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...