Android Thingsプロジェクトを使用してAndroid App上のGPIOポートを制御しようとしています。 しかし、私は(Androidのメーカーの)ADBを通じて、このアプリを実行すると、以下のメッセージが発行されます。..Android Things ProjectでINSTALL_FAILED_MISSING_SHARED_LIBRARYを解決する方法
インストールがメッセージ INSTALL_FAILED_MISSING_SHARED_LIBRARYで失敗しました。この問題は、 が存在する場合にapkの既存のバージョンをアンインストールしてから再インストールすることで解決される可能性があります。
警告:アンインストールするとアプリケーションデータが削除されます。
既存のアプリケーションをアンインストールしますか?
この問題を解決するにはどうすればよいですか?
Androidのバージョンは5.1.1(API 22) 私のAndroidアプリのアプリのためのbuild.gradleは以下の通りであるAndroidの物事プロジェクト(https://developer.android.com/things/sdk/pio/gpio.html#managing_the_connection)
を説明するウェブサイトに従って符号化されるAndroidのです。
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "kr.iges.wallpad.gpiotest"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.1.0'
provided 'com.google.android.things:androidthings:0.1-devpreview'
}
そして、あなたがこの問題の解決策を知っていたAndroidManifest.xmlが
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kr.iges.wallpad.gpiotest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<uses-library android:name="com.google.android.things"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.IOT_LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
で、Javaコードが
package kr.iges.wallpad.gpiotest;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.google.android.things.pio.PeripheralManagerService;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "GpioTest";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PeripheralManagerService manager = new PeripheralManagerService();
List<String> portList = manager.getGpioList();
if (portList.isEmpty()) {
Log.i(TAG, "No GPIO port available on this device.");
} else {
Log.i(TAG, "List of available ports: " + portList);
}
setContentView(R.layout.activity_main);
}
}
のですか?
読んでいただきありがとうございます。