2017-07-29 11 views
6

हर बात काम ठीकAndroid प्रोग्राम समस्या: पथ शून्य या खाली स्ट्रिंग नहीं हो सकता है। पथ = 'अशक्त'

minifyEnabled true

और

shrinkResources true

की स्थापना इन मूल्यों को स्थापित करने के बाद से पहले, जब भी मैं प्रोजेक्ट को चलाने मैं इस त्रुटि मिलती है:

Information:Gradle tasks [:app:assembleProdRelease] 
Error:path may not be null or empty string. path='null' 
Information:BUILD FAILED 
Information:Total time: 23.606 secs 
Information:1 error 
Information:0 warnings 
Information:See complete output in console 

क्या क्या यह त्रुटि त्रुटि है: पथ शून्य या खाली स्ट्रिंग नहीं हो सकता है। पथ = 'अशक्त' यहाँ build.gradle है:

signingConfigs { 
      release { 
       storeFile file('/home/rishabh/Documents/dekhoJks/release.jks') 
       storePassword "XXXXXXX" 
       keyAlias "XXXXXXXX" 
       keyPassword "XXXXXXXXX" 
      } 
     } 
     buildTypes { 
      release { 
       minifyEnabled true 
       //proguardFiles fileTree(dir: "proguard", include: ["*.pro"]).asList().toArray() 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
       shrinkResources true 
       signingConfig signingConfigs.release 
      } 
     } 

और मैं हर एक लानत बात मैं में proguard.pro डाल सकते हैं डालने की कोशिश की: चलाने में असमर्थ

-optimizationpasses 5 
-dontusemixedcaseclassnames 
-dontskipnonpubliclibraryclasses 
-dontskipnonpubliclibraryclassmembers 
-dontpreverify 
-verbose 
-dump class_files.txt 
-printseeds seeds.txt 
-printusage unused.txt 
-printmapping mapping.txt 
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 

-allowaccessmodification 
-keepattributes *Annotation* 
-renamesourcefileattribute SourceFile 
-keepattributes SourceFile,LineNumberTable 
-repackageclasses '' 

-keep public class * extends android.app.Activity 
-keep public class * extends android.app.Application 
-keep public class * extends android.app.Service 
-keep public class * extends android.content.BroadcastReceiver 
-keep public class * extends android.content.ContentProvider 
-keep public class * extends android.app.backup.BackupAgentHelper 
-keep public class * extends android.preference.Preference 
-keep public class com.android.vending.licensing.ILicensingService 
-dontnote com.android.vending.licensing.ILicensingService 

# Explicitly preserve all serialization members. The Serializable interface 
# is only a marker interface, so it wouldn't save them. 
-keepclassmembers class * implements java.io.Serializable { 
    static final long serialVersionUID; 
    private static final java.io.ObjectStreamField[] serialPersistentFields; 
    private void writeObject(java.io.ObjectOutputStream); 
    private void readObject(java.io.ObjectInputStream); 
    java.lang.Object writeReplace(); 
    java.lang.Object readResolve(); 
} 

# Preserve all native method names and the names of their classes. 
-keepclasseswithmembernames class * { 
    native <methods>; 
} 

-keepclasseswithmembernames class * { 
    public <init>(android.content.Context, android.util.AttributeSet); 
} 

-keepclasseswithmembernames class * { 
    public <init>(android.content.Context, android.util.AttributeSet, int); 
} 

# Preserve static fields of inner classes of R classes that might be accessed 
# through introspection. 
-keepclassmembers class **.R$* { 
    public static <fields>; 
} 

# Preserve the special static methods that are required in all enumeration classes. 
-keepclassmembers enum * { 
    public static **[] values(); 
    public static ** valueOf(java.lang.String); 
} 

-keep public class * { 
    public protected *; 
} 

-keep class * implements android.os.Parcelable { 
    public static final android.os.Parcelable$Creator *; 
} 
##---------------End: proguard configuration common for all Android apps ---------- 

#---------------Begin: proguard configuration for support library ---------- 
-keep class android.support.v4.app.** { *; } 
-keep interface android.support.v4.app.** { *; } 
-keep class com.actionbarsherlock.** { *; } 
-keep interface com.actionbarsherlock.** { *; } 

# The support library contains references to newer platform versions. 
# Don't warn about those in case this app is linking against an older 
# platform version. We know about them, and they are safe. 
-dontwarn android.support.** 
-dontwarn com.google.ads.** 
##---------------End: proguard configuration for Gson ---------- 

##---------------Begin: proguard configuration for Gson ---------- 
# Gson uses generic type information stored in a class file when working with fields. Proguard 
# removes such information by default, so configure it to keep all of it. 
-keepattributes Signature 

# For using GSON @Expose annotation 
-keepattributes *Annotation* 

# Gson specific classes 
-keep class sun.misc.Unsafe { *; } 
#-keep class com.google.gson.stream.** { *; } 

# Application classes that will be serialized/deserialized over Gson 
-keep class com.example.model.** { *; } 

##---------------End: proguard configuration for Gson ---------- 

# If your project uses WebView with JS, uncomment the following 
# and specify the fully qualified class name to the JavaScript interface 
# class: 
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { 
# public *; 
#} 




-keepclassmembers class android.support.design.internal.BottomNavigationMenuView { 
    boolean mShiftingMode; 
} 

-dontwarn com.fasterxml.** 
-dontwarn okio.** 
-dontwarn retrofit2.** 
-dontwarn com.fasterxml.jackson.databind.** 

# Basic ProGuard rules for Firebase Android SDK 2.0.0+ 
-keep class com.firebase.** { *; } 
-keep class org.apache.** { *; } 
-keepnames class com.fasterxml.jackson.** { *; } 
-keepnames class javax.servlet.** { *; } 
-keepnames class org.ietf.jgss.** { *; } 
-dontwarn org.apache.** 
-dontwarn org.w3c.dom.** 

-dontwarn com.firebase.ui.** 

-keepattributes Signature 

-dontwarn com.googlecode.mp4parser.** 
-dontwarn org.mp4parser.aspectj.runtime.reflect.** 
-keep class * implements com.coremedia.iso.boxes.Box { *; } 
-dontwarn com.coremedia.iso.boxes.** 
-dontwarn com.googlecode.mp4parser.authoring.tracks.mjpeg.** 
-dontwarn com.googlecode.mp4parser.authoring.tracks.ttml.** 

-keep class com.facebook.** { 
    *; 
} 

लेकिन फिर भी मेरी एप्लिकेशन। कोई मदद जहां मैं गलत जा रहा हूँ।

+0

मैं भी इस पर अटक गया हूं। – Michael

उत्तर

0

ठीक है समाधान मिला।

release { 
       storeFile file('/home/rishabh/Documents/dekhoJks/release.jks') 
       storePassword "XXXXXXX" 
       keyAlias "XXXXXXXX" 
       keyPassword "XXXXXXXXX" 
      } 

और इसके बजाय इस बात का अलग signing.properties फ़ाइल बनाने:: बस अपनी हार्ड codded हस्ताक्षर करने config की जगह

STORE_FILE=/home/XXX/XXX/XXX 
STORE_PASSWORD=XXXXXX 
KEY_ALIAS=XXXXXXXX 
KEY_PASSWORD=XXXXXXXXX 

enter image description here

और अपने Gradle में इस्तेमाल करते हैं। उम्मीद है कि यह मदद करता है !!

+0

मेरे अंत में इस मुद्दे को ठीक नहीं करता है। –

+0

मेरे लिए भी काम नहीं कर रहा है। – ggsrivas

1

दो समाधान

  • निम्नलिखित classpath का प्रयोग करें। (मैं जब मैं संस्करण 2.3.2 उपयोग कर रहा था इस त्रुटि हो रही थी।)

    classpath 'com.android.tools.build:gradle:2.2.2'

  • एक अस्थायी ठीक के लिए विभाजन apk विकल्प को अक्षम अगर आप classpath संस्करण नहीं बदल सकते।

+0

कोई अन्य समाधान? – ggsrivas

+0

मैंने आपको पहले से ही दो विकल्प दिए हैं। आप कितना चाहते हैं? –

+1

ये दोनों विकल्प अस्थायी हैं। मैं सोच रहा था कि क्या आपको कोई वास्तविक समाधान मिला है। – ggsrivas

संबंधित मुद्दे