毕加索无法在Android中加载

e_ori

我将.jar文件放在/ libs文件夹中,并将其添加为库,现在我的build.gradle文件具有以下依赖性:

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':SmoothProgressBar')
compile 'com.squareup.picasso:picasso:2.5.0'

我的清单是这样的

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.prova" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

但是,当我需要加载图像时,它什么也不做,并且logcat也没有错误。这是我的代码:

public class MainActivity extends ActionBarActivity {

private ImageView img;

private String image = "http://i.stack.imgur.com/LOb1t.png";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    img = (ImageView) findViewById(R.id.image);

    Picasso.with(this).setLoggingEnabled(true);
    Picasso.with(this).load(Uri.parse(image)).into(img);
    }

}

我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/img"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true" />

</RelativeLayout>

在Eclipse中工作正常,没有任何问题。提前致谢。

编辑:这是我的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.enrico.prova"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.squareup.picasso:picasso:2.5.0'
}

EDIT2:Logcat:

02-23 16:41:36.857  28865-28865/com.example.enrico.prova D/Picasso﹕ Main        created      [R1] Request{http://www.online-image-editor.com//styles/2014/images/example_image.png}
02-23 16:41:36.858  28865-28884/com.example.enrico.prova D/Picasso﹕ Dispatcher  enqueued     [R1]+0ms
02-23 16:41:36.876  28865-29238/com.example.enrico.prova D/Picasso﹕ Hunter      executing    [R1]+16ms
02-23 16:41:36.883  28865-28884/com.example.enrico.prova D/Picasso﹕ Dispatcher  batched      [R1]+25ms for error
02-23 16:41:37.112  28865-28884/com.example.enrico.prova D/Picasso﹕ Dispatcher  delivered    [R1]+254ms
02-23 16:41:37.112  28865-28865/com.example.enrico.prova D/Picasso﹕ Main        errored      [R1]+255ms
伊曼纽尔

您在中拥有权限<application>他们应该从<manifest>外面进去<application>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

毕加索android图像无法加载

来自分类Dev

毕加索图片在Android中加载缓慢,为什么?

来自分类Dev

无法在Android中加载Facebook图片

来自分类Dev

[React Native]图像无法在Android中加载

来自分类Dev

无法在 android studio 中加载 .so

来自分类Dev

android:从毕加索的sdcard加载图像

来自分类Dev

毕加索加载图像错误-Android

来自分类Dev

毕加索加载图像错误-Android

来自分类Dev

在Android Studio中加载项目时出错:无法加载模块

来自分类Dev

毕加索仅在BaseAdapter中加载一张图像

来自分类Dev

无法使用毕加索从磁盘加载图像

来自分类Dev

无法从文件://毕加索路径加载图像

来自分类Dev

毕加索加载后android获取Drawable图片

来自分类Dev

毕加索图像加载问题与Android 9.0馅饼

来自分类Dev

某些Webp图片无法在Android 4+中加载

来自分类Dev

无法在Android的Web视图中加载Flash

来自分类Dev

解析SDK Android应用无法在5.0中加载内容

来自分类Dev

无法使用Picasso库在android中加载图像

来自分类Dev

android:无法在选项卡视图中加载weview

来自分类Dev

Google Map无法在Android中加载它的给出错误

来自分类Dev

无法使用Picasso库在android中加载图像

来自分类Dev

无法在Android Studio中加载Custom Gradle插件的类

来自分类Dev

Tinymce 无法在 android 中加载 skin.min.css

来自分类Dev

无法获取要在 android kotlin 中加载的列表

来自分类Dev

无法在 Android 项目中加载预构建的 OpenSSL 库

来自分类Dev

在Android中加载相机

来自分类Dev

无法在ImageViewAsync中加载图像

来自分类Dev

无法在样板中加载Animate

来自分类Dev

无法在jar中加载资源