簡體   English   中英

Android安裝錯誤:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED“錯誤13”

[英]Android Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED “error 13”

我正在開發一個小型應用程序,其中列出了存在/已安裝在android設備上的所有應用程序。 但是我在嘗試運行代碼時遇到以下錯誤。

安裝錯誤:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

請誰能幫助我解決此錯誤。 我在堆棧上閱讀了所有類似的錯誤文章,但是它們都沒有幫助。 因此,我也把我的源代碼希望有人可以幫助我。

主要活動清單:

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.ankitverma.energyharvest"
    android:versionCode="1"
    android:versionName="1.0" >
    <permission
        android:name="info.ankitverma.energharvest.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="info.ankitverma.energharvest.permission.MAPS_RECEIVE" />

    <uses-sdk
        android:minSdkVersion="12"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- Required to show current location -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <!-- Required OpenGL ES 2.0. for Maps V2 -->
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="Energy Harvest">
        <uses-library
        android:name="com.google.android.maps" />
        <activity
            android:name="info.ankitverma.energyharvest.MainActivity"
            android:label="Energy Harvest"
            android:theme="@style/AppBaseTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <!-- Goolge API Key -->
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyDOxEOjotMFhFPxhtea72ryXKDpwGQQESw"
             />
        <meta-data  android:name="com.google.android.gms.version"/>
    </application>
</manifest>

主要活動Java文件:

    package info.ankitverma.energyharvest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final MapFragment mapFragment = (MapFragment)getFragmentManager().findFragmentById(R.id.map);
        final MapWrapperLayout mapWrapperLayout = (MapWrapperLayout)findViewById(R.id.map_relative_layout);
        final GoogleMap map = mapFragment.getMap();

        // MapWrapperLayout initialization
        // 39 - default marker height
        // 20 - offset between the default InfoWindow bottom edge and it's content bottom edge 
        mapWrapperLayout.init(map, getPixelsFromDp(this, 39 + 20)); 

        // We want to reuse the info window for all the markers, 
        // so let's create only one class member instance
        this.infoWindow = (ViewGroup)getLayoutInflater().inflate(R.layout.info_window, null);
        this.infoTitle = (TextView)infoWindow.findViewById(R.id.title);
        this.infoSnippet = (TextView)infoWindow.findViewById(R.id.snippet);
        this.infoButton = (Button)infoWindow.findViewById(R.id.button);

        // Setting custom OnTouchListener which deals with the pressed state
        // so it shows up 
        this.infoButtonListener = new OnInfoWindowElemTouchListener(infoButton,
                getResources().getDrawable(R.drawable.dbh1),
                getResources().getDrawable(R.drawable.dbh10)) 
        {
            @Override
            protected void onClickConfirmed(View v, Marker marker) {
                // Here we can perform some action triggered after clicking the button
                Toast.makeText(MainActivity.this, marker.getTitle() +  getResources().getDrawable(R.drawable.dbh10), Toast.LENGTH_SHORT).show();
            }
        }; 
        this.infoButton.setOnTouchListener(infoButtonListener);


        map.setInfoWindowAdapter(new InfoWindowAdapter() {
            @Override
            public View getInfoWindow(Marker marker) {
                return null;
            }

            @Override
            public View getInfoContents(Marker marker) {
                // Setting up the infoWindow with current's marker info
                infoTitle.setText(marker.getTitle());
                infoSnippet.setText(marker.getSnippet());
                infoButtonListener.setMarker(marker);

                // We must call this to set the current marker and infoWindow references
                // to the MapWrapperLayout
                mapWrapperLayout.setMarkerWithInfoWindow(marker, infoWindow);
                return infoWindow;
            }
        });

        LatLng IrvinePark = new LatLng(33.646091,-117.842737);
        LatLng IrvineDBH = new LatLng(33.643197,-117.841996);
        LatLng IrvineStudentCenter = new LatLng(33.64944,-117.842469);
        LatLng IrvineParkingStructure1 = new LatLng(33.643152,-117.837608);
        LatLng IrvineParkingStructure2 = new LatLng(33.647542,-117.837489);
        LatLng IrvineFoodCourt1 = new LatLng(33.645939,-117.844325);
        LatLng IrvineFoodCourt2 = new LatLng(33.645626,-117.840709);
        LatLng IrvineTheater = new LatLng(33.649181,-117.840773);
        LatLng IrvineLibrary1 = new LatLng(33.645751,-117.846739);
        LatLng IrvineLibrary2 = new LatLng(33.647341,-117.84146);

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvinePark, 13));

        map.addMarker(new MarkerOptions()
                .title("Alrich Park")
                .snippet("University of california Irvine")
                .position(IrvinePark));

        //
        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineDBH, 13));

        map.addMarker(new MarkerOptions()
                .title("DBH")
                .snippet("University of california Irvine")
                .position(IrvineDBH));


        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineStudentCenter, 13));

        map.addMarker(new MarkerOptions()
        .title("Student Center")
        .snippet("University of california Irvine")
        .position(IrvineStudentCenter));
        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineParkingStructure1, 13));

        map.addMarker(new MarkerOptions()
        .title("Anteater Parking Structure")
        .snippet("University of california Irvine")
        .position(IrvineParkingStructure1));

        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineFoodCourt1, 13));

        map.addMarker(new MarkerOptions()
        .title("BC Caverns Food Court")
        .snippet("University of california Irvine")
        .position(IrvineFoodCourt1));
        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineFoodCourt2, 13));

        map.addMarker(new MarkerOptions()
        .title("Phenoix Food Court")
        .snippet("University of california Irvine")
        .position(IrvineFoodCourt2));
        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineTheater, 13));

        map.addMarker(new MarkerOptions()
        .title("Irvine Barcaly Theater")
        .snippet("University of california Irvine")
        .position(IrvineTheater));
        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineLibrary1, 13));

        map.addMarker(new MarkerOptions()
        .title("Science Library")
        .snippet("University of california Irvine")
        .position(IrvineLibrary1));
        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineLibrary2, 13));

        map.addMarker(new MarkerOptions()
        .title("Between Langson and Gateway")
        .snippet("University of california Irvine")
        .position(IrvineLibrary2));
        //

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(IrvineParkingStructure2, 13));

        map.addMarker(new MarkerOptions()
        .title("Social Sicence Parking Structure")
        .snippet("University of california Irvine")
        .position(IrvineParkingStructure2));
    }

    public static int getPixelsFromDp(Context context, float dp) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int)(dp * scale + 0.5f);
    }
}

活動主體:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>


</RelativeLayout>

嘗試移動

<permission
    android:name="info.ankitverma.energharvest.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" 

<uses-permission標簽下面

或刪除“ gen”文件夾,然后讓它自己重新創建。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM