我正在开发的应用程序适用于 ios,但不适用于 android。在将 nativescript 版本从 3.4.1 更新到 3.4.3 并将 Mac OS 更新到 High Sierra 之前,它之前已经工作过。
然后我不得不更新 Android Studio 版本。
以下是 tns debug android 的输出。
Searching for devices...
Preparing project...
Gradle build...
+ applying user-defined configuration from /Mobile/NativeScript-Projects/Genkan/app/App_Resources/Android/app.gradle
+ adding nativescript runtime package dependency: nativescript-optimized
+ adding aar plugin dependency: /Mobile/NativeScript-Projects/Genkan/node_modules/nativescript-imagepicker/platforms/android/nativescript_imagepicker.aar
+ adding aar plugin dependency: /Mobile/NativeScript-Projects/Genkan/node_modules/nativescript-ui-listview/platforms/android/TNSListView-release.aar
+ adding aar plugin dependency: /Mobile/NativeScript-Projects/Genkan/node_modules/nativescript-ui-sidedrawer/platforms/android/TNSSideDrawer-release.aar
+ adding aar plugin dependency: /Mobile/NativeScript-Projects/Genkan/node_modules/nativescript-ui-core/platforms/android/TNSCore-release.aar
+ adding aar plugin dependency: /Mobile/NativeScript-Projects/Genkan/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
FAILURE: Build failed with an exception.
* Where:
Build file '/Mobile/NativeScript-Projects/Genkan/platforms/android/app/build.gradle' line: 64
* What went wrong:
A problem occurred configuring project ':app'.
> Could not get unknown property 'outputFile' for task ':app:packageDebug' of type com.android.build.gradle.tasks.PackageApplication.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="2"
android:versionName="2.1">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="__APILEVEL__"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/LaunchScreenTheme"
android:windowSoftInputMode="adjustPan">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
</application>
</manifest>