安卓:当我尝试安装我签的应用程序,它说:"未安装&QUOT应用; [英] Android: When I try to install my signed app, it says "App not installed"

查看:143
本文介绍了安卓:当我尝试安装我签的应用程序,它说:"未安装&QUOT应用;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图安装一个签名的apk文件,应用程序安装程序说不安装应用程序。
它发生在我尽了一切应用程序。 即使我创建了一个全新的密钥库,或者如果我设置的构建模式进行调试。
虽然它工作,如果我通过Android工作室安装它。但如果我要与我的朋友我不能分享。
我试图寻找一个问题,可以提出上诉我的情况在这个网站,但我还没有发现任何。
我的应用程序正在运行,且(据说)签署。我找不到任何理由其无法正常工作。

When I try to install a signed apk file, the application installer says "App not installed".
It happens to every app that I have made. Even if I create a brand new keystore, or if I set the build mode to debug.
Although it does work if I install it through the Android Studio. But if I need to share it with my friends I can't.
I tried to look for a question that can appeal my situation on this site, but I haven't found any.
My application is working and (supposedly) signed. I can't find any reason for it not to work.

例如,这是code为JustJava应用程序,我与Android开发课程Udacity。

For example, this is the code for the JustJava app I made with the android development course at Udacity.

该activity_main.xml是:

The activity_main.xml is:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">


<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp">

    <EditText
        android:id="@+id/name"
        android:hint="@string/name_field"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="text"
        android:layout_marginBottom="16dp"/>

    <TextView
        style="@style/HeaderTextStyle"
        android:text="@string/toppings" />


    <CheckBox
        android:id="@+id/topping_whipped_cream"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:paddingLeft="24dp"
        android:text="@string/topping_whipped_cream" />
    <CheckBox
        android:id="@+id/topping_chocolate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:layout_marginLeft="16dp"
        android:paddingLeft="24dp"
        android:text="@string/topping_chocolate" />

    <TextView
        style="@style/HeaderTextStyle"
        android:text="@string/quantity" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="16dp">

        <Button

            android:id="@+id/decrement"
            android:layout_width="48dp"
            android:layout_height="wrap_content"
            android:onClick="decrement"
            android:text="@string/minus" />

        <TextView
            android:id="@+id/quantity_text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingBottom="16dp"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:paddingTop="16dp"
            android:text="@string/quantity_num"
            android:textColor="@android:color/black"
            android:textSize="18sp" />

        <Button
            android:id="@+id/increment"
            android:layout_width="48dp"
            android:layout_height="wrap_content"
            android:onClick="increment"
            android:text="@string/plus" />

    </LinearLayout>


    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">


        <Button
            android:id="@+id/order"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="submitOrder"
            android:text="@string/order_btn" />
    </LinearLayout>

</LinearLayout>

而Java是:

package com.example.android.justjava;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import java.text.NumberFormat;

/**
 * This app displays an order form to order coffee.
 */
public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
/**
 * Assigns the name text field
 */


/**
 * This method is called when the order button is clicked.
 */
int quantity = 1;

public void submitOrder(View view) {
    EditText name = (EditText) findViewById(R.id.name);
    String clientName = name.getText().toString();

    Intent submit = new Intent(Intent.ACTION_SEND);
    submit.setData(Uri.parse("mailto:"));
    submit.setType("*/*");
    submit.putExtra(Intent.EXTRA_CC, "roeyvi19@gmail.com");
    submit.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.mail_subject_order) + clientName);
    submit.putExtra(Intent.EXTRA_TEXT, createOrderSummary());
    if (submit.resolveActivity(getPackageManager()) != null) {
        startActivity(submit);
    }
}

public void increment(View view) {
    if (quantity < 99) {
        quantity += 1;
        displayQuantity(quantity);
    } else {
        Toast toast = Toast.makeText(getApplicationContext(),
                getString(R.string.over_100_coffees_toast), Toast.LENGTH_LONG);
        toast.show();
    }
}

public void decrement(View view) {
    if (quantity == 1) {
        Toast toast = Toast.makeText(getApplicationContext(), R.string.no_coffees_toast, Toast.LENGTH_SHORT);
        toast.show();
    } else {
        quantity -= 1;
        displayQuantity(quantity);
    }

}

/**
 * This method displays the given quantity value on the screen.
 *
 * @param quant
 */
private void displayQuantity(int quant) {
    TextView quantityTextView = (TextView) findViewById(
            R.id.quantity_text_view);
    quantityTextView.setText("" + quant);
}


/**
 * Creates a visual summary of the order.
 * <p/>
 * quantity is the number of cups of coffee ordered
 */

private String createOrderSummary() {
    /**
     * Assigns the whipped cream checkbox
     */
    CheckBox toppingWhippedCream = (CheckBox) findViewById(R.id.topping_whipped_cream);
    boolean isCheckedWhippedCream = toppingWhippedCream.isChecked();
    /**
     * Assigns the chocolate checkbox
     */
    CheckBox toppingChocolate = (CheckBox) findViewById(R.id.topping_chocolate);
    boolean isCheckedChocolate = toppingChocolate.isChecked();
    //retrieve client's name
    EditText name = (EditText) findViewById(R.id.name);
    String clientName = name.getText().toString();
    /**
     * Inputs the total price
     */
    int pricePerCup = 5;
    if (isCheckedWhippedCream) {
        pricePerCup += 1;
    }

    if (isCheckedChocolate) {
        pricePerCup += 2;
    }
    int totalPrice = pricePerCup * quantity;
    return          //returns the name of the client
            getString(R.string.name_at_order_summary) + clientName + "\n"
                    //return quantity
                    + getString(R.string.quantity_at_order_summary) + quantity + "\n"
                    //return if whipped cream is checked
                    + getString(R.string.topping_whipped_cream_at_order_summary) + isCheckedWhippedCream + "\n"
                    //return if chocolate is checked
                    + getString(R.string.topping_chocolate_at_order_summary) + isCheckedChocolate + "\n"
                    //return total price
                    + getString(R.string.total_price_at_order_summary) + totalPrice + "\n" +
                    getString(R.string.thank_you_at_order_summary);
}


}

Mainfest:

Mainfest:

<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <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>

感谢您!

推荐答案

检查一下来宾帐户(如果你是在模拟的Andr​​oid 5.0+)应用程序被安装或没有,如果是,则删除它,并从IDE重新安装

Check if in guests account(if you are emulating in android 5.0+) the app is installed or not, if yes then remove it and re-install from IDE.

这篇关于安卓:当我尝试安装我签的应用程序,它说:&QUOT;未安装&QUOT应用;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆